react-native-open-especifics-settings
This module allows us to open device-specific settings. For example, if we want to open the GPS configuration to see if it is on / off or change it, or open the Location configuration window or Wifi, battery and others.
Getting started
$ npm install react-native-open-especifics-settings --save
Mostly automatic installation
$ react-native link react-native-open-especifics-settings
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-open-especifics-settings
and addRNOpenEspecificsSettings.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNOpenEspecificsSettings.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNOpenEspecificsSettingsPackage;
to the imports at the top of the file - Add
new RNOpenEspecificsSettingsPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-open-especifics-settings' project(':react-native-open-especifics-settings').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-open-especifics-settings/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-open-especifics-settings')
Usage
Parameter options
- 'general'
- 'location'
- 'network'
- 'security'
- 'deviceinfo'
- 'backup'
- 'sound'
- 'home'
- 'date'
- 'applications'
Note: Due to major changes to the Apple device access policy, only access to the main menu is available.
; // Opens the especific settings window, example: 'location'.RNOpenEspecificsSettings
Credits
Written by Flavio Teodosio.