{"repo":"kevinresol/react-native-default-preference","free":true,"listed":false,"github":"https://github.com/kevinresol/react-native-default-preference","clone":"git clone https://github.com/kevinresol/react-native-default-preference.git","description":"Use SharedPreference (Android) and UserDefaults (iOS) with React Native over a unified interface","language":"Java","stars":274,"topics":["react-native","ios","android","sharedpreferences","userdefaults"],"license":"MIT","category":"mobile-apps","readme_excerpt":"react-native-default-preference Use SharedPreferences (Android) and UserDefaults (iOS) with React Native over a unified interface. All data is stored as a string. If you need to support more complex data structures, use serialization/deserialization (e.g. JSON). Getting started $ npm install react-native-default-preference --save React Native = 0.60 $ cd ios && pod install React Native <= 0.59 $ react-native link react-native-default-preference Manual installation iOS 1. In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name] 2. Go to node modules/react-native-default-preference/ios and add RNDefaultPreference.xcodeproj 3. In XCode, in the project navigator, select your project. Add libRNDefaultPreference.a to your project's Build Phases ➜ Link Binary With Libraries 4. Run your project ( Cmd+R )< Android 1. Open up android/app/src/main/java/[...]/MainApplication.java - Add import com.kevinresol.react native default preference.RNDefaultPreferencePackage; to the imports at the top of the file - Add new RNDefaultPreferencePackage() to the list returned by the getPackages() method 2. Append the following lines to android/settings.gradle : 3. Insert the following lines inside the dependencies block in android/app/build.gradle : Usage API Cordova Native Storage Compatibility This module is compatible with cordova-plugin-native-storage. Android You need to use the same SharedPreference as in the cordova plugin, to do so add the following line: ","default_branch":null,"files":null,"tree":[],"storefront":"/r/kevinresol","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kevinresol/react-native-default-preference/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}