Miss any of our Open RFC calls?Watch the recordings here! »

react-native-open-security-settings

0.0.4 • Public • Published

react-native-open-security-settings

Getting started

$ npm install react-native-open-security-settings --save

Mostly automatic installation

$ react-native link react-native-open-security-settings

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.reactlibrary.OpenSecuritySettingsPackage; to the imports at the top of the file
  • Add new OpenSecuritySettingsPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-open-security-settings'
    project(':react-native-open-security-settings').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-open-security-settings/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-open-security-settings')
    

Usage

import {Platform} from 'react-native'
import OpenSecuritySettings from 'react-native-open-security-settings';
 
if(Platform.OS == 'android'){
    OpenSecuritySettings.openSecuritySettings()
}else{
    Linking.openURL('app-settings:')
}
 
//Additional Method: isDeviceSecure
let isSecure = await OpenSecuritySettings.isDeviceSecure();
 
 

Keywords

Install

npm i react-native-open-security-settings

DownloadsWeekly Downloads

5

Version

0.0.4

License

MIT

Unpacked Size

329 kB

Total Files

90

Last publish

Collaborators

  • avatar