Skip to content

An up to date plugin for Cordova 4, 5, 6, and 7 that opens native settings views / pages on IOS and Android.

License

Notifications You must be signed in to change notification settings

BradyNadeau/cordova-plugin-native-settings

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-native-settings - For Cordova 4, 5, 6, 7

The plugin allows you to open OS settings on iOS 8/9/10 and Android, via cordova-based app. For example, it will allow you to open the keyboard settings, Wifi, bluetooth etc (full list below).

Adding/Removing the Plugin

It will be saved to the config.xml file

cordova plugin (add|rm) cordova-plugin-native-settings --save

Using the plugin (opens Location Settings in Android and Application Settings in iOS)

cordova.plugins.settings.open(setting_constant, success_callback, failure_callback);

Example for iOS and Android - open Wifi settings

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!');
}

In Android, by default it is opened in the same application as a new activity, the hardware back button will bring the user back to the previous activity (the app). In order to open settings as a new application (two applications will appear in "recent/opened" apps list) the following code can be used: window.cordova.plugins.settings.open(["wifi", true], function() {}, function() {}); ....

Settings Options

You can use any constant from the following list:

  • I tried to map Android and iOS together, however, they are not always the same.
    "about", // ios
    "accessibility", // ios, android
    "account", // ios, android
    "airplane_mode", // ios, android
    "apn", // android
    "application_details", // ios, android
    "application_development", // android
    "application", // android
    "autolock", // ios
    "bluetooth", // ios, android
    "castle", // ios
    "captioning", // android
    "cast", // android
    "cellular_usage", // ios
    "configuration_list", // ios
    "data_roaming", // android
    "date", // ios, android
    "display", // ios, android
    "dream", // android
    "facetime", // ios
    "home", // android
    "keyboard", // ios, android
    "keyboard_subtype", // android
    "locale", // ios, android
    "location", // ios, android
    "manage_all_applications", // android
    "manage_applications", // android
    "memory_card", // android
    "music", // ios
    "music_equalizer", // ios
    "music_volume", // ios
    "network", // ios, android
    "nike_ipod", // ios
    "nfcsharing", // android
    "nfc_payment", // android
    "nfc_settings", // android
    "notes", // ios
    "notification_id", // ios
    "passbook", // ios
    "phone", // ios
    "photos", // ios
    "print", // android
    "privacy", // android
    "quick_launch", // android
    "reset", // ios
    "ringtone", // ios
    "browser", // ios
    "search", // ios, android
    "security", // android
    "settings", // ios, android
    "show_regulatory_info",
    "sound", // ios, android
    "software_update", // ios
    "storage", // ios, android
    "store", // ios, android
    "sync", // android
    "tethering", // ios
    "twitter", // ios
    "usage", // ios, android
    "user_dictionary", // android
    "video", // ios
    "voice_input", // android
    "vpn", // ios
    "wallpaper", // ios
    "wifi_ip", // android
    "wifi", // ios, android
    "wireless" // android

Notes

Contributing / Issues

  • If you would like an additional setting / page that this plugin supports please do a PR ( feel free to send me an email to get it merged even faster; my email is in the author section in package.json ), or you can feel free to create a feature request in the issues section and hopefully the community can assist you.
  • Please understand we all have lives outside of open-source and we can not ALL help you with the issue(s) at hand. Before creating an issue, please give as much information as possible so no one is wasting their time trying to debug a problem that may not actually exist.
  • No hate speech.

About

An up to date plugin for Cordova 4, 5, 6, and 7 that opens native settings views / pages on IOS and Android.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 53.1%
  • Objective-C 44.9%
  • JavaScript 2.0%