React Native OS Settings Manager
This is a native module to interact with Android/IOS settings.
Installation
npm install --save react-native-os-settings-manager
react-native link
Features
ANDROID
Method name | Return value |
---|---|
areNotificationsEnabled | Boolean |
openAppSettings | Void |
IOS
Method name | Return value |
---|---|
areNotificationsEnabled | {badge:1, alert:1, sound:1} or {} if notifications disabled |
openAppSettings | Void |
Usage
; /*** This will open the os settings of your application.*/RNOsSettingsManager; /*** This will tell you if notifications are enabled or not in Android/IOS settings*/let notifications_enabled = await RNOsSettingsManager; if PlatformOS == 'android' // ANDROID device console; console; else if PlatformOS == 'ios' // IOS device console; console; console; console;