//TODO: 此处可以用一个提醒框来处理
//如果没给权限:显示提醒
if ([CLLocationManager locationServicesEnabled] && ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse || [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized)) {
//定位功能可用
shareLocationUploadManager = [DRuploaddataAndLocationManager shareManager];
}else if ([CLLocationManager authorizationStatus] ==kCLAuthorizationStatusDenied) {
//定位不能用
[self showAlertWithTitle:@"请求打开定位权限" Message:@"" CancelTitle:@"不定位" OthersTitles:@[@"定位"] ConfirmHandel:^(NSInteger index) {
if (index==1) {
NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}
}
}];
}else if([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined){
[self showAlertWithTitle:@"请求定位权限" Message:@"" CancelTitle:@"取消" OthersTitles:@[@"确定"] ConfirmHandel:^(NSInteger index) {
if (index==1) {
shareLocationUploadManager = [DRuploaddataAndLocationManager shareManager];
}else{
}
}];
}