Closed rajinpangkalpundai closed 4 years ago
Hi @rajinpangkalpundai
You can definitely store anything in keychain due to library restrictions the keys in the store will be username and password only
. You can refer to react-native-keychain for more info.
So You can store mobile or other info as username and password
and when you get the stored data here you can change like this
export const getLoginCredentials = async () => {
try {
const credentials = await Keychain.getGenericPassword();
console.log("keychain get data ", credentials);
if (credentials) {
return {YOURKEYONE: credentials.username, YOURKEYTWO:credentials.password};
}
return false;
} catch (e) {
console.log("Cannot retrieve keychain data", e);
return false;
}
};
replace YOURKEYONE & YOURKEYTWO to your custom keys.
YOURKEYONE
i've checked react-native-keychain, and yes, it has limitation to only store in 'username' and 'password'. Another question is: Is it possible to use AsyncStorage on 'Services' folder to save my login credentials and later use it to maintain the app state (session)?
Thank you for your quick reply, i really appreciate it.
Yes you can use it in whatever way you want.
Yes you can use it in whatever way you want.
Awesome! thanks for your help
Hello @HarishJangra ,
I have a project that uses OTP as the authenticator to log in into the app. Could you please show me the Login Navigation Flow and how do i use easy-peasy? i want to store the phone number and token to the local storage, while your initial boilerplate uses username and password instead. Kindly need your help asap. btw, thank you very much for the repo, it really helps cutting down some development time.