I used to develop in android previously and i used to used SharePreference for storing user tokens. Is there anything such available in react native for both ios and android? >
use expo-secure-store
// to install it 'expo install expo-secure-store'
import * as SecureStore from 'expo-secure-store';
const setToken = (token) => {
return SecureStore.setItemAsync('secure_token', token);
};
const getToken = () => {
return SecureStore.getItemAsync('secure_token');
};
setToken('#your_secret_token');
getToken().then(token => console.log(token)); // output '#your_secret_token'