Closed TomSeldon closed 7 years ago
This might be caused by #5 - on our devices the Objective-C was never successfully setting the value in the keychain because it was trying to use TouchID
I am also having this issue, and I noticed something else that is weird as well.
The success function (argument 1 of Keychain.get) takes a 'value'. If I check that value in the function, for example:
function (value) { alert(value); }
Then in the alert I get that the value is true/false based on what I set the key's value to be. But if I try to assign that value in the function, like so:
var example;
Keychain.get( function (value) { example = value; alert(example); }, . . .[other arguments]. . .);
alert(example);
then I find that the alert inside Keychain.get shows example having a value equal to the key's value, but the alert outside Keychain.get shows example having no value.
This seems related so I'm noting it here instead of creating another issue, but I could be completely wrong on that.
That's just because your third line (the alert
) is not guaranteed to be called after the asynchronous callback that sets example
's value :)
Ah, I didn't catch that. Thank you. I've applied the change from #5 so I'll see how that goes. Update for information: The change that fixes #5 can be found in #8
UPDATE: The change for #5 did not fix the issue.
Can you try the new version in master? I can't reproduce this...it might have just been fixed with some random changes. Also try a different key name, sometimes that uses stale data/metadata and keychain gets angry
Closing as most likely fixed
I've tried using this plugin as described in
README.md
but I can't seem to get it to work. There are no errors, but on setting and getting a key/value the success callback is always called withnull
as the only argument.Am I doing something wrong?
See below output which was run on an iPad running iOS9:
I'd expect the final call,
Keychain.get(onSuccess, onFail, 'someKey', 'message')
to call the success callback withvalue
(the string set in the previous call). This doesn't happen.