ionic cordova打开系统设置

发布于 1周前 作者 gougou168 最后一次编辑是 5天前 来自 分享

ionic cordova打开系统设置可以用 cordova-open-native-settings

cordova-open-native-settings地址: https://github.com/zliu9/cordova-open-native-settings

ionic cordova打开系统设置插件 cordova-open-native-settings用法

1、安装

ionic cordova plugin (add|rm) cordova-open-native-settings

2、使用

	cordova.plugins.settings.open(setting_constant, success_callback, failure_callback);
if (window.cordova && window.cordova.plugins.settings) {
    console.log('openNativeSettingsTest is active');
    window.cordova.plugins.settings.open("wifi", function() {
            console.log('opened settings');
        },
        function () {
            console.log('failed to open settings');
        }
    );
} else {
    console.log('openNativeSettingsTest is not active!');
}	
回到顶部