@connected-home/react-native-android-shared-preferences
v1.1.2
Published
Android Shared Preferences for React Native
Downloads
19
Readme
React Native Android Shared Preferences
Android Shared Preferences for React Native
Install
npm install @connected-home/react-native-android-shared-preferences --save
# or...
yarn add @connected-home/react-native-android-shared-preferences
Link
react-native link @connected-home/react-native-android-shared-preferences
Usage
Import
const SharedPreferences = require("react-native-android-shared-preferences");
// or...
import SharedPreferences from "react-native-android-shared-preferences";
Get item
SharedPreferences.getItem("file", "key", value => {
...
});
Get multiple items
SharedPreferences.getItems("file", ["key1", "key2"], values => {
...
});
Get keys
SharedPreferences.keys("file", keys => {
...
});
Get entries
SharedPreferences.entries("file", entries => {
console.log(values);
});
Set Item
SharedPreferences.setItem("file", "key", "value");
Delete Item
SharedPreferences.deleteItem("file", "key");
Clear all items
SharedPreferences.clear("file");
Delete Prefs File
SharedPreferences.deleteFile("file");