For securely storing sensitive data in react-native application there is different approaches for different platforms.
- For iOS application we will use Keychain Services
- For android application we will use Android KeyStore System
React Native library “react-native-secure-key-store”
This library internally store sensitive data securely to KeyChain and KeyStore service in iOS and Android respectively.
The plugin can be installed via the npm:
$ npm install react-native-secure-key-store --save
or via yarn
$ yarn add react-native-secure-key-store --save
Linking library to project automatically
$ react-native link react-native-secure-key-store
Above library will expose three methods
remove for storing data, retrieving data and removing data which is no longer needed respectively.
Complete usage of library in a typical react-native application
Source code available at react-native-secure-key-store