Git Product home page Git Product logo

cordova-open-native-settings's Introduction

#NativeSettings plugin for Cordova

The plugin allows you to open OS settings on iOS 9 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) https://github.com/guyromb/Cordova-open-native-settings.git --save

or via npm (It will be saved to the package.json file)

npm (install|rm) https://github.com/guyromb/Cordova-open-native-settings.git --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

cordova-open-native-settings's People

Contributors

deefactorial avatar guyromb avatar jakub-swierk avatar mriegler avatar selahssea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.