wuzy0001
wuzy0001
  • 发布:2017-03-11 13:10
  • 更新:2020-07-16 10:12
  • 阅读:4434

IOS10 打开系统设置

分类:HTML5+

IOS原有跳转Wi-Fi设置是”prefs:root=WIFI”,新的写法是”App-Prefs:root=WIFI”

function networkType(){
var types = {};
types[plus.networkinfo.CONNECTION_UNKNOW] = "Unknown connection";
types[plus.networkinfo.CONNECTION_NONE] = "No connection";
types[plus.networkinfo.CONNECTION_ETHERNET] = "Ethernet connection";
types[plus.networkinfo.CONNECTION_WIFI] = "WiFi connection";
types[plus.networkinfo.CONNECTION_CELL2G] = "Cellular 2G connection";
types[plus.networkinfo.CONNECTION_CELL3G] = "Cellular 3G connection";
types[plus.networkinfo.CONNECTION_CELL4G] = "Cellular 4G connection";

if (plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE || plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_UNKNOW) {
mui.toast("当前暂无网络连接,请打开数据服务!", "提示");
mui.confirm('网络出错,请检查网络配置', '温馨提示', ['退出', '设置'], function(e){
if(e.index == 0){
} else {
if(mui.os.ios){
plus.runtime.launchApplication({action:'App-Prefs:root=WIFI'}, function(e){
console.log(JSON.stringify(e));
}); //WIFI
} else {
var main = plus.android.runtimeMainActivity();
var Intent = plus.android.importClass("android.content.Intent");
var mIntent = new Intent('android.settings.WIFI_SETTINGS');
main.startActivity(mIntent);
}
}
});
}
else {
console.log(types[plus.networkinfo.getCurrentType()]);
}
}

5 关注 分享
弄月 走走江南 1***@qq.com rueen 漠

要回复文章请先登录注册

5***@qq.com

5***@qq.com

回复 2***@qq.com :
我直接把后面放空prefs:root=,到的还是应用设置页
2020-07-16 10:12
5***@qq.com

5***@qq.com

回复 2***@qq.com :
IOS怎么到系统设置首页?
2020-07-16 10:11
5***@qq.com

5***@qq.com

苹果怎么到手机设置的首页
2020-07-16 10:11
2***@qq.com

2***@qq.com

回复 2***@qq.com :
let mIntent = new Intent('android.settings.SETTINGS');//打开系统设置页面
2020-04-23 17:53
2***@qq.com

2***@qq.com

var main = plus.android.runtimeMainActivity();
var Intent = plus.android.importClass("android.content.Intent");
var mIntent = new Intent('android.settings.SECURITY_SETTINGS');
main.startActivity(mIntent);

这样也行。就打开系统设置页面,不会到WiFi设置页面
2020-04-23 17:46