添加toast,和定位提示

This commit is contained in:
kai60 2020-06-11 21:15:54 +08:00
parent b8d6ad08ea
commit 94d926fdaa
3 changed files with 65 additions and 2 deletions

View File

@ -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;

View File

@ -9,6 +9,7 @@
#import "ConAquarMethodVC.h"
#import "SecondConnectWifiController.h"
#import "ConAquarNowWiFiPwdVC.h"
#import <CoreLocation/CoreLocation.h>
@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{

View File

@ -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:@"未有设备响应"];
}
});
});