添加toast,和定位提示
This commit is contained in:
parent
b8d6ad08ea
commit
94d926fdaa
|
|
@ -15745,7 +15745,7 @@
|
||||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 14;
|
CURRENT_PROJECT_VERSION = 16;
|
||||||
DEVELOPMENT_TEAM = WFX8GD5HFX;
|
DEVELOPMENT_TEAM = WFX8GD5HFX;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
|
|
@ -15863,7 +15863,7 @@
|
||||||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Manual;
|
||||||
CURRENT_PROJECT_VERSION = 14;
|
CURRENT_PROJECT_VERSION = 16;
|
||||||
DEVELOPMENT_TEAM = WFX8GD5HFX;
|
DEVELOPMENT_TEAM = WFX8GD5HFX;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#import "ConAquarMethodVC.h"
|
#import "ConAquarMethodVC.h"
|
||||||
#import "SecondConnectWifiController.h"
|
#import "SecondConnectWifiController.h"
|
||||||
#import "ConAquarNowWiFiPwdVC.h"
|
#import "ConAquarNowWiFiPwdVC.h"
|
||||||
|
#import <CoreLocation/CoreLocation.h>
|
||||||
@interface ConAquarMethodVC ()
|
@interface ConAquarMethodVC ()
|
||||||
Strong UILabel *subTitleLabel;
|
Strong UILabel *subTitleLabel;
|
||||||
|
|
||||||
|
|
@ -74,6 +75,48 @@ Strong UILabel *subTitleLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.view.backgroundColor = COLOR_Background;
|
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.
|
// Do any additional setup after loading the view.
|
||||||
}
|
}
|
||||||
-(void)buttonClick:(UIButton *)sender{
|
-(void)buttonClick:(UIButton *)sender{
|
||||||
|
|
|
||||||
|
|
@ -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:@"未有设备响应"];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue