Skip to content
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

Keychain add/remove value in the background #523

Open
lehelmedves opened this issue May 13, 2021 · 4 comments
Open

Keychain add/remove value in the background #523

lehelmedves opened this issue May 13, 2021 · 4 comments

Comments

@lehelmedves
Copy link

Hello,

This is an incredibly useful library, thank you for developing and maintaining it.
I have one problem, that I've run into and I'd like to pick your brain about it in hope of finding a solution to it.

I am trying to update a Keychain key-value pair right inside the following method, while receiving a silent push notification:
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)
It seems to work at first, however the new value doesn't really get saved, most probably because the app is only running for a short amount of time when woken up by the silent push notification. When I open the app and read back the value, it's still the old one.

Have you ever encountered this issue? Do you have any idea how this could be avoided?

Thank you in advance.

@yegorsch
Copy link

Are you calling the completion handler? The documentation says you should have up to 30s to process the notification.

@lehelmedves
Copy link
Author

Yes, I do initiate the value update and right after that I call the completion handler.

@nattnh751
Copy link

I am having a similar problem to this.

@nattnh751
Copy link

evgenyneu/keychain-swift#15 possibly another example of this issue. Possible work around : evgenyneu/keychain-swift#78 (comment). Note I have not yet tried this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants