README
Description
React Native module to open settings screen in Android and more.
Installation
npm install react-native-android-settings-tool
react-native link react-native-android-settings-tool
Usage
Require the react-native-android-settings-tool
module.
import RNAndroidSettingsTool from "react-native-android-settings-tool";
RNAndroidSettingsTool.ACTION_SETTINGS(); // Open the main settings screen.
Expamles
Show notification settings:
import RNAndroidSettingsTool from "react-native-android-settings-tool";
//In some cases, a matching Activity may not exist, so ensure you safeguard against this
try {
// "null" is your app
RNAndroidSettingsTool.ACTION_APP_NOTIFICATION_SETTINGS(null); // Show notification settings for your app.
// or other app (ex. Facebook)
RNAndroidSettingsTool.ACTION_APP_NOTIFICATION_SETTINGS("com.facebook.katana"); // Show notification settings for another package name "com.facebook.katana" NotificationChannel with id 123.
} catch (e) {
// your code
}
Show notification channel settings:
import RNAndroidSettingsTool from "react-native-android-settings-tool";
//In some cases, a matching Activity may not exist, so ensure you safeguard against this
try {
// "null" is your app
RNAndroidSettingsTool.ACTION_CHANNEL_NOTIFICATION_SETTINGS(null, "123"); // Show notification settings for your app NotificationChannel with id 123.
// or other app (ex. Instagram)
RNAndroidSettingsTool.ACTION_CHANNEL_NOTIFICATION_SETTINGS("com.instagram.android", "123"); // Show notification settings for another package name "com.instagram.android" NotificationChannel with id 123.
} catch (e) {
// your code
}
Show application details screen:
import RNAndroidSettingsTool from "react-native-android-settings-tool";
try {
// "null" is your app
RNAndroidSettingsTool.ACTION_APPLICATION_DETAILS_SETTINGS(null); // Show screen of details about your application.
// or other app (ex. Google Chrome)
RNAndroidSettingsTool.ACTION_APPLICATION_DETAILS_SETTINGS("com.android.chrome"); // Show screen details of about for another package name "com.android.chrome".
} catch (e) {
// your code
}
Docs
Functions
Functions | Description | Read more |
---|---|---|
ACTION_SETTINGS(); |
Show system settings. | Link |
ACTION_APP_NOTIFICATION_SETTINGS(packageName); |
Show notification settings for a single app. | Link |
ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS(packageName); |
Show notification bubble settings for a single app. | Link |
ACTION_APPLICATION_DETAILS_SETTINGS(packageName); |
Show screen of details about a particular application. | Link |
ACTION_BATTERY_SAVER_SETTINGS(); |
Show battery saver settings. | Link |
ACTION_BLUETOOTH_SETTINGS(); |
Show settings to allow configuration of Bluetooth. | Link |
ACTION_CAPTIONING_SETTINGS(); |
Show settings for video captioning. | Link |
ACTION_CAST_SETTINGS(); |
Show settings to allow configuration of cast endpoints. | Link |
ACTION_CHANNEL_NOTIFICATION_SETTINGS(packageName, chanelID); |
Show notification settings for a single NotificationChannel. | Link |
ACTION_DATA_ROAMING_SETTINGS(); |
Show settings for selection of 2G/3G. | Link |
ACTION_DATE_SETTINGS(); |
Show settings to allow configuration of date and time. | Link |
ACTION_DEVICE_INFO_SETTINGS(); |
Show general device information settings (serial number, software version, phone number, etc.). | Link |
ACTION_DISPLAY_SETTINGS(); |
Show settings to allow configuration of display. | Link |
ACTION_DREAM_SETTINGS(); |
Show Daydream settings. | Link |
ACTION_FINGERPRINT_ENROLL(); |
Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if necessary. | Link |
ACTION_HARD_KEYBOARD_SETTINGS(); |
Show settings to configure the hardware keyboard. | Link |
ACTION_HOME_SETTINGS(); |
Show Home selection settings. | Link |
ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS(packageName); |
Show screen for controlling background data restrictions for a particular application. | Link |
ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS(); |
Show screen for controlling which apps can ignore battery optimizations. | Link |
ACTION_INPUT_METHOD_SETTINGS(); |
Show settings to configure input methods, in particular allowing the user to enable input methods. | Link |
ACTION_INPUT_METHOD_SUBTYPE_SETTINGS(); |
Show settings to enable/disable input method subtypes. | Link |
ACTION_INTERNAL_STORAGE_SETTINGS(); |
Show settings for internal storage. | Link |
ACTION_LOCALE_SETTINGS(); |
Show settings to allow configuration of locale. | Link |
ACTION_LOCATION_SOURCE_SETTINGS(); |
Show settings to allow configuration of current location sources. | Link |
ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS(); |
Show settings to manage all applications. | Link |
ACTION_MANAGE_APPLICATIONS_SETTINGS(); |
Show settings to manage installed applications. | Link |
ACTION_MANAGE_DEFAULT_APPS_SETTINGS(); |
Show Default apps settings. | Link |
ACTION_MANAGE_OVERLAY_PERMISSION(packageName); |
Show screen for controlling which apps can draw on top of other apps. | Link |
ACTION_MANAGE_UNKNOWN_APP_SOURCES(packageName); |
Show settings to allow configuration of trusted external sources. | Link |
ACTION_MANAGE_WRITE_SETTINGS(packageName); |
Show screen for controlling which apps are allowed to write/modify system settings. | Link |
ACTION_MEMORY_CARD_SETTINGS(); |
Show settings for memory card storage. | Link |
ACTION_NETWORK_OPERATOR_SETTINGS(); |
Show settings for selecting the network operator. | Link |
ACTION_NFCSHARING_SETTINGS(); |
Show NFC Sharing settings. This shows UI that allows NDEF Push (Android Beam) to be turned on or off. | Link |
ACTION_NFC_PAYMENT_SETTINGS(); |
Show NFC Tap & Pay settings. This shows UI that allows the user to configure Tap&Pay settings. | Link |
ACTION_NFC_SETTINGS(); |
Show NFC settings. This shows UI that allows NFC to be turned on or off. | Link |
ACTION_NIGHT_DISPLAY_SETTINGS(); |
Show settings to allow configuration of Night display. | Link |
ACTION_NOTIFICATION_ASSISTANT_SETTINGS(); |
Show Notification assistant settings. | Link |
ACTION_NOTIFICATION_LISTENER_SETTINGS(); |
Show Notification listener settings. | Link |
ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS(); |
Show Do Not Disturb access settings. | Link |
ACTION_PRINT_SETTINGS(); |
Show the top level print settings. | Link |
ACTION_PRIVACY_SETTINGS(); |
Show settings to allow configuration of privacy options. | Link |
ACTION_QUICK_LAUNCH_SETTINGS(); |
Show settings to allow configuration of quick launch shortcuts. | Link |
ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS(packageName); |
Ask the user to allow an app to ignore battery optimizations. | Link |
ACTION_REQUEST_SET_AUTOFILL_SERVICE(packageName); |
Show screen that let user select its Autofill Service. | Link |
ACTION_SEARCH_SETTINGS(); |
Show settings for global search. | Link |
ACTION_SECURITY_SETTINGS(); |
Show settings to allow configuration of security and location privacy. | Link |
ACTION_SOUND_SETTINGS(); |
Show settings to allow configuration of sound and volume. | Link |
ACTION_SYNC_SETTINGS(); |
Show settings to allow configuration of sync settings. | Link |
ACTION_USAGE_ACCESS_SETTINGS(); |
Show settings to control access to usage information. | Link |
ACTION_USER_DICTIONARY_SETTINGS(); |
Show settings to manage the user input dictionary. | Link |
ACTION_VOICE_INPUT_SETTINGS(); |
Show settings to configure input methods, in particular allowing the user to enable input methods. | Link |
ACTION_VPN_SETTINGS(); |
Show settings to allow configuration of VPN. | Link |
ACTION_VR_LISTENER_SETTINGS(); |
Show VR listener settings. | Link |
ACTION_WEBVIEW_SETTINGS(); |
Allows user to select current webview implementation. | Link |
ACTION_WIFI_IP_SETTINGS(); |
Show settings to allow configuration of a static IP address for Wi-Fi. | Link |
ACTION_WIFI_SETTINGS(); |
Show settings to allow configuration of Wi-Fi. | Link |
ACTION_WIRELESS_SETTINGS(); |
Show settings to allow configuration of wireless controls such as Wi-Fi, Bluetooth and Mobile networks. | Link |
ACTION_ZEN_MODE_PRIORITY_SETTINGS(); |
Show Zen Mode (aka Do Not Disturb) priority configuration settings. | Link |
Parameters
Name | Type | Description |
---|---|---|
packageName | String or null |
ex. "com.my.app" null is your app. |
chanelID | String |
Notification chanel ID. ex. "123" |