Skip to content

rjblopes/react-native-device-settings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-device-settings

React Native simple platform agnostic API to open up device settings menus

Install

npm install react-native-device-settings --save

Automatic Install

react-native link react-native-device-settings

Manual Install

iOS

-NA: using Linking RN library. URLs applicable for IOS 10.

Android

  1. In settings.gradle, insert the following code:

    include ':react-native-device-settings'
    project(':react-native-device-settings').projectDir = new File(settingsDir, '../node_modules/react-native-device-settings/android')
    
  2. In build.gradle, insert the following code:

    android {
      ...
    }
    ...
    
    dependencies {
      ...
    + compile project(':react-native-device-settings')
    }
    ...
    
  3. Edit MainActivity.java to look like this

    ...
    
    import com.rjblopes.opensettings.OpenSettingsPackage; // <-- add this import
    ...
    

Usage

import DeviceSettings from 'react-native-device-settings';

// Open settings menu
DeviceSettings.open();

// Open app settings menu
DeviceSettings.app();

// Open wifi settings menu
DeviceSettings.wifi();

Dev Notes

Developed for personal use and might be useful for others.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published