直接跳转淘宝
This commit is contained in:
@@ -97,22 +97,14 @@ Strong UILabel *subTitleLabel;
|
||||
|
||||
|
||||
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 *ok = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}];
|
||||
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}];
|
||||
[alert addAction:ok];
|
||||
[alert addAction:cancel];
|
||||
//[alert addAction:cancel];
|
||||
|
||||
[self presentViewController:alert animated:YES completion:nil];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user