diff --git a/Ifish.xcodeproj/project.pbxproj b/Ifish.xcodeproj/project.pbxproj index bfa6cd8..9ca10cf 100644 --- a/Ifish.xcodeproj/project.pbxproj +++ b/Ifish.xcodeproj/project.pbxproj @@ -15745,7 +15745,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 14; + CURRENT_PROJECT_VERSION = 16; DEVELOPMENT_TEAM = WFX8GD5HFX; ENABLE_BITCODE = NO; ENABLE_TESTABILITY = YES; @@ -15863,7 +15863,7 @@ CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 14; + CURRENT_PROJECT_VERSION = 16; DEVELOPMENT_TEAM = WFX8GD5HFX; ENABLE_BITCODE = NO; ENABLE_TESTABILITY = YES; diff --git a/Ifish/controllers/ConnectAauariumVC/ConAquarMethodVC.m b/Ifish/controllers/ConnectAauariumVC/ConAquarMethodVC.m index 4205792..d7dbe32 100644 --- a/Ifish/controllers/ConnectAauariumVC/ConAquarMethodVC.m +++ b/Ifish/controllers/ConnectAauariumVC/ConAquarMethodVC.m @@ -9,6 +9,7 @@ #import "ConAquarMethodVC.h" #import "SecondConnectWifiController.h" #import "ConAquarNowWiFiPwdVC.h" +#import @interface ConAquarMethodVC () Strong UILabel *subTitleLabel; @@ -74,6 +75,48 @@ Strong UILabel *subTitleLabel; } self.view.backgroundColor = COLOR_Background; + if ([CLLocationManager locationServicesEnabled] && ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse || [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized)) { + + //定位功能可用 + + + + + }else if ([CLLocationManager authorizationStatus] ==kCLAuthorizationStatusDenied) { + + + UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"需要定位权限才能获取wifi信息给设备配网,来添加设备" preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *ok = [UIAlertAction actionWithTitle:@"打开定位" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; + + if([[UIApplication sharedApplication] canOpenURL:url]) { + if (@available(iOS 10.0, *)) { + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; + }else { + [[UIApplication sharedApplication] openURL:url]; + } + } + }]; + UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { + [self.navigationController popViewControllerAnimated:YES]; + }]; + [alert addAction:ok]; + [alert addAction:cancel]; + + [self presentViewController:alert animated:YES completion:nil]; + + + + + + }else if([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined){ + + CLLocationManager* locationManager = [[CLLocationManager alloc] init]; + + + [locationManager requestWhenInUseAuthorization]; + + } // Do any additional setup after loading the view. } -(void)buttonClick:(UIButton *)sender{ diff --git a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m index fb75f76..a8fdc62 100644 --- a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m +++ b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m @@ -645,6 +645,26 @@ extern BOOL isfromCameraView; } } + else if(firstResult.isCancelled) + { + self.lodviewMissStyle=lodingViewdissMissfail; + [self mmPogressHUDdismiss]; + [self connectNormalView]; + self.bakbutton.userInteractionEnabled=YES; + [self.view makeToast:@"连接被取消"]; + + } + + else if(!esptouchResultArray.count) + { + self.lodviewMissStyle=lodingViewdissMissfail; + [self mmPogressHUDdismiss]; + [self connectNormalView]; + self.bakbutton.userInteractionEnabled=YES; + [self.view makeToast:@"未有设备响应"]; + + } + }); });