Failure on setGenericPassword()
See original GitHub issueAttempting to get setup with react-native-keychain but I am receiving the error below.
TypeError: Cannot read property 'setGenericPasswordForService' of undefined(…)
I’ve installed the npm library and linked it with rnpm. I checked my Libraries folder in XCode to confirm RNKeychain.xcodeproj was installed and I can see the library installed in the Linked Binaries as well.
import Keychain from 'react-native-keychain';
export default class Init extends Component {
componentDidMount() {
var username = 'zuck';
var password = 'poniesRgr8';
Keychain
.setGenericPassword(username, password)
.then(function() {
console.log('Credentials saved successfully!');
}).catch(function(error) {
console.log('Could not set Generic Password. ', error);
});
}
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:10
- Comments:19
Top Results From Across the Web
React native keychain error when using setGenericPassword ...
I resolved the problem by defining the STORAGE_TYPE let options: Keychain.Options = { storage:Keychain.STORAGE_TYPE.FB};.
Read more >react-native-keychain - Bountysource
I am using react-native-keychain 6.2.0 and see this error when using ... i am running into an issue on Samsung devices when calling...
Read more >How to use the react-native-keychain.getGenericPassword ...
To help you get started, we've selected a few react-native-keychain.getGenericPassword examples, based on popular ways it is used in public projects.
Read more >react-native-keychain - npm
setGenericPassword (username, password); try { // Retreive the credentials const credentials = await Keychain.
Read more >React Native Biometrics | by Zalmy Muskal - Medium
The format is setGenericPassword(username, password, [{ accessControl, ... After 5 failed attempts ... getsupportedBioemtryType() will return null }
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m getting this error on
"react-native": "0.40.0","react-native-keychain": "^1.1.0"
and fixes withimport * as Keychain from 'react-native-keychain';
instead ofimport Keychain from 'react-native-keychain';
Thanks for the response @akullpp I did this before but what i was doing wrong is the import. Import Keychain from ‘react-native-keychain’ instead of Import * as Keychain …