Update README.md

This commit is contained in:
Vojtech Novak 2018-02-25 22:18:26 +01:00 committed by GitHub
parent f596fa68bd
commit 7efae775e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -52,6 +52,10 @@ Error: {
See `KeychainExample` for fully working project example. See `KeychainExample` for fully working project example.
Both `setGenericPassword` and `setInternetCredentials` allow to store strings only!
Both `getInternetCredentials` and `getGenericPassword` will resolve to the stored value, or to false, in case there is no record stored. They will reject only if an unexpected error is encountered.
```js ```js
import * as Keychain from 'react-native-keychain'; import * as Keychain from 'react-native-keychain';
@ -71,7 +75,7 @@ Keychain
.then(function(credentials) { .then(function(credentials) {
console.log('Credentials successfully loaded for user ' + credentials.username); console.log('Credentials successfully loaded for user ' + credentials.username);
}).catch(function(error) { }).catch(function(error) {
console.log('Keychain couldn\'t be accessed! Maybe no value set?', error); console.log('Keychain couldn\'t be accessed!', error);
}); });
// service argument optional // service argument optional