ios 打开app应用权限
ios 打开app应用权限 var cllocationManger = plus.ios.importClass("CLLocationManager"); var enable = cllocationManger.locationServicesEnabled(); var status = cllocationManger.authorizationStatus(); console.log("enable:" + enable); console.log("status:" + status); if (enable && status != 2) { console.log("手机系统的定位已经打开"); } else { console.log("手机系统的定位没有打开"); // 定位没有开启时 提示用户是否开启 plus.nativeUI.confirm("定位权限没有开启,是否去开启?", function(e) { if (e.index == 1) { var UIApplication = plus.ios.importClass("UIApplication"); var application2 = UIApplication.sharedApplication(); var NSURL2 = plus.ios.importClass("NSURL"); var setting2 = NSURL2.URLWithString("app-settings:"); // 打开应用权限 application2.openURL(setting2); plus.ios.deleteObject(setting2); plus.ios.deleteObject(NSURL2); plus.ios.deleteObject(application2); } }, { "buttons": ["不开启", "去设置"], "verticalAlign": "center" }); } plus.ios.deleteObject(cllocationManger);
相关推荐
zrtlin 2020-11-09
xuebingnan 2020-11-05
wikiwater 2020-10-27
heheeheh 2020-10-19
Crazyshark 2020-09-15
softwear 2020-08-21
ZGCdemo 2020-08-16
jczwilliam 2020-08-16
littleFatty 2020-08-16
idning 2020-08-03
jinxiutong 2020-07-26
lanzhusiyu 2020-07-19
Skyline 2020-07-04
xiaofanguan 2020-06-25
Aveiox 2020-06-23
dragonzht 2020-06-17