-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Returns nil when just appeared from background #20
Comments
I'm getting this same behavior. |
I think this may happens because of iPhone locking. It always auto-locks because of touch-ID enabled. So some keychain items can be unavailable IMHO. |
Could be, looks like its hitting line 153 and returning nil there. SecItemCopyMatching is not returning a success. |
Same error here. Log:
|
I'm also having an issue with returning nil when coming back to app |
I've solved problem by caching keychain data in property.
|
What's weird is, I saw this issue twice within 30 minutes of loading an app with UICKeyChainStore for the first time. The following 24 hours I never could reproduce it a single time. |
Getting the same bug here. Here's how I consistently reproduce it:
|
please take a look to the UICKeychain documentation. you need to call the [keyChain setAccessibility: ....... ] function. |
Same here randomly returning nil with warning "OSStatus error: [-34018] Security error has occurred" For me this wasn't due to application going to background/foreground, it just happens randomly |
Having the same issue here, the application goes back from background, and I have the "Security error has occurred" both when trying to set and get a value from the keychain. |
Alright so I made it work on my device. All it took was to set nil to the accessGroup, and rely on the fact that it takes the first group in the entitlement as default group. I don't know if it's a bug within iOS or a signing issue. |
@jayztemplier how did you set the accessGroup to nil? I am getting the same issue and curretnly it is a read only property. Did you mod the source? |
I can consistently reproduce this too, doing what @briankracoff described. @jayztemplier 's solution unfortunately did not work for me. Version 1 was working fine. Will investegate. |
@jayztemplier same thing |
anyone fix it? |
@dannyjiajia I just tried this because I had a thought last night: in - (void)applicationDidBecomeActive:(UIApplication *)application } It seemed to have worked! Try it out? |
@theprojectabot Your solution unfortunately did not work for me.I cached the value as @k06a |
I am also experiencing this problem already in : -(void)applicationWillEnterForeground:(UIApplication *)application } I am also getting the error: OSStatus error: [-34018] Security error has occurred. |
@MortenFalcon happens to me too only while debugging, and not always. |
+1 while debugging only |
Why is this happening? Is there any fix? |
Same issue here, only occurs sometimes, but its annoying because I use it to manage the state of the app. |
+1 while debugging it appears. Doesnt affect the app on the store at the moment. |
Is anybody solve this problem ? |
OSStatus error: [-34018] Security error has occurred. this problem occurs sometimes,can anybody help me? |
Just cache this value in property. |
Any solution? |
This is a known apple bug in the keychain that has yet to be fixed https://forums.developer.apple.com/thread/4743 Facebook and others that depend on app switching for oauth are notably affected. https://m.facebook.com/login.php?next=https%3A%2F%2Fdevelopers.facebook.com%2Fbugs%2F136880803313865&refsrc=https%3A%2F%2Fwww.facebook.com%2Flogin.php&_rdr |
@Blahartinger thanks for your helpful links. |
I came across the same issue too. |
4 years later and this issue is still occurring for me, exclusively when the app is woken up in the background due to a significant location change. |
Still there :) |
1 similar comment
Still there :) |
Seeing this as well. Anyone have a fix? |
This code sometimes returns nil when my app is just appeared from background:
When I restart app - it returns non-nil value.
The text was updated successfully, but these errors were encountered: