Telerik-Verified-Plugins / Keychain

Apache Cordova (PhoneGap) plugin
Other
8 stars 4 forks source link

Keychain Failed #5

Closed centhi closed 8 years ago

centhi commented 8 years ago

On few of the iOS device it doesn't works and says this error - keychain failed, Please check the attachment, Please help us to fix this issue.

EddyVerbruggen commented 8 years ago

Only a screenshot will not help much.. can you provide more info?

centhi commented 8 years ago

We used this following code for the Keychain.

var iOSKeyChain = new Keychain()

// To set the keychain iOSKeyChain.setForKey(function() { console.log('Keychaing SuccessFully Set'); }, function() { console.log('Keychain Failed'); }, KeyChainUniqueKey, KeyName, Content);

// To get the keychain iOSKeyChain.getForKey( function(data) { console.log(data) }, function(Error){alert('Keychain Error:'+ Error); }, KeyChainUniqueKey, KeyName);

EddyVerbruggen commented 8 years ago

And where does the 'Keychain Fails' message come from?

EddyVerbruggen commented 8 years ago

I can't tell from this snippet whether or not you're waiting for deviceready to fire. It's really little to go on this way..

centhi commented 8 years ago

That alert got from this below snippet on deviceready

// To get the keychain iOSKeyChain.getForKey( function(data) { console.log(data) }, function(Error){alert('Keychain Fails'); }, KeyChainUniqueKey, KeyName);

if iphone/ipad not enabled for the iCloud, got this error when app opened.

EddyVerbruggen commented 8 years ago

So if you enable iCloud all is fine, but if it's disabled you see this error?

centhi commented 8 years ago

Thanks for your reply, I've found the issue, When app opens first time, keychain was empty. So that error raised.

Is anyway to find & delete the keychain, before our app started ?

EddyVerbruggen commented 8 years ago

Your app is responsible for manipulating its won keychain. It's empty after a fresh install and you can check that and act accordingly. You can even remove entries with removeForKey if necessary. Should suffice for any scenario imo.