react-native-android-native-app-settings
v0.1.6
Published
API for getting shared preferences in Android
Downloads
9
Readme
react-native-android-native-app-settings
Getting started
npm install react-native-android-native-app-settings --save
Mostly automatic installation
react-native link react-native-android-native-app-settings
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNAndroidNativeAppSettingsPackage;
to the imports at the top of the file - Add
new RNAndroidNativeAppSettingsPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-android-native-app-settings' project(':react-native-android-native-app-settings').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-native-app-settings/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-android-native-app-settings')
Usage
settings.android.js
import RNAndroidNativeAppSettings from 'react-native-android-native-app-settings';
export default async function getAppSettings() {
return await RNAndroidNativeAppSettings.getAll();
}