Skip to content
No description, website, or topics provided.
Java Objective-C JavaScript
Branch: master
Clone or download
Pull request Compare This branch is even with shubham56:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
React Native Open Settings.xcodeproj
android
.DS_Store
README.md
RNOpenSettings.h
RNOpenSettings.m
index.js
package.json

README.md

react-native-open-settings

npm version

Open your apps settings in the Settings app :P

Install

npm install react-native-open-settings

iOS

Add React Native Open Settings to project libraries.

Android

  • Edit build.gradle to look like this:
apply plugin: 'com.android.application'

android {
  ...
}

dependencies {
  ...
+ compile project(':react-native-open-settings')
}
  • In settings.gradle, insert the following code:
include ':react-native-open-settings'
project(':react-native-open-settings').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-open-settings/android')
  • Edit your MainActivity.java to look like this:
package com.myapp;

....
import com.opensettings.OpenSettingsPackage

public class MainActivity extends extends ReactActivity {

    @Override
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
                new MainReactPackage(),
                new OpenSettingsPackage()
        );
    }
    ...
}

Usage

Require the react-native-open-settings module.

import OpenSettings from 'react-native-open-settings';

And then, where you want to open the settings, just do

OpenSettings.openSettings()

Have fun!

You can’t perform that action at this time.