A React Native bridge to Android's native SharedPreferences key-value storage. Version 1.0.2 is stable but unmaintained since 2018. It provides synchronous and callback-based get/set operations, with support for getting multiple items and all keys. This library requires manual linking and is intended for Android only, unlike cross-platform alternatives like @react-native-async-storage/async-storage. It is suitable for legacy RN projects (<0.60) that do not use autolinking.
npm install react-native-shared-preferencesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: import, set name, set a string, and retrieve it via callback.
Migrate to @react-native-async-storage/async-storage or expo-secure-store.
Wrap calls in Platform.OS === 'android' checks or use a cross-platform library.
Follow manual linking steps in README or use react-native link.
Call setName early in app initialization.
Use Array.from() or spread operator to convert.
Ensure manual linking steps are followed, or use react-native link react-native-shared-preferences.
Call SharedPreferences.setName('yourName') before any get/set operation.Change to const SharedPreferences = require('react-native-shared-preferences');Use SharedPreferences.getItems(keys, callback) for multiple keys, or getAllKeys(callback) for all keys.