1.1.0 • Published 7 years ago

react-native-android-settings v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

React Native Android Settings

This is an Android native module to interact with Android settings.

Installation

npm install --save react-native-android-settings

react-native link

Features

Method nameReturn value
isNotificationEnabledBoolean
accessAppSettingsVoid

Usage

import ReactNativeAndroidSettings from 'react-native-android-settings';

/**
* This will open the android settings about your application.
*/
ReactNativeAndroidSettings.accessAppSettings();

/**
* This will tell you if notifications are enabled or not by Android settings
*/
try {
  let isNotificationEnabled = await ReactNativeAndroidSettings.isNotificationEnabled();

  console.assert(isNotificationEnabled == true,
    'If true, it means that the notifications for your application are enabled by Android');

  console.assert(isNotificationEnabled == false,
    'If false, it means that the notifications for your application are disabled by Android');
} catch (e) {
  console.error(e);
}