Open gracekrcx opened 2 years ago
Doc : doc
Usage 範例:
import * as Keychain from 'react-native-keychain'; async () => { const username = 'zuck'; const password = 'poniesRgr8'; // Store the credentials await Keychain.setGenericPassword(username, password); try { // Retrieve the credentials const credentials = await Keychain.getGenericPassword(); if (credentials) { console.log( 'Credentials successfully loaded for user ' + credentials.username ); } else { console.log('No credentials stored'); } } catch (error) { console.log("Keychain couldn't be accessed!", error); } await Keychain.resetGenericPassword(); };
參考文章: JavaScript 之旅 (7):Async Functions & await (2)
起因
Doc : doc
Usage 範例:
參考文章: JavaScript 之旅 (7):Async Functions & await (2)