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

how to pass items from Keychain between iOS project and watchOS extension app #572

Open
Maks273 opened this issue Jul 24, 2023 · 4 comments

Comments

@Maks273
Copy link

Maks273 commented Jul 24, 2023

No description provided.

@Maks273
Copy link
Author

Maks273 commented Jul 24, 2023

i tried to use accessGroup but I have no idea why it's not working, maybe I did something wrong...could you explain how to share data from Keychain between iOS and watchOS targets pls?

@djmckee
Copy link

djmckee commented Jul 24, 2023

+1, seeing this issue

@kishikawakatsumi
Copy link
Owner

Historically it was possible to share a keychain access group between your phone app and your watch extension because they both ran on the same device (the phone). This is no longer the case. Modern versions of watchOS run your watch extension on the watch, which is a different device from the phone app (the phone), and there’s no keychain access group sharing between devices.
One option here is to push your keychain items up to iCloud Keychain via the

kSecAttrSynchronizable

option.

If the user does not use iCloud Sync, this functionality is not available. In that case, consider using Watch Connectivity to send and receive data directly, for example.

See also:
https://damian.fyi/swift/2020/07/23/sharing-tokens-between-macos-ios-and-watchos-using-icloud-keychain.html
https://www.wwdcnotes.com/notes/wwdc21/10003/

@emkou
Copy link

emkou commented Nov 16, 2023

Not using the SPM but actually importing the files inside the main app target made it possible to user shared keychain between the apps, i guess tehre is something with shared keychain and SPM packages that makes this not possible

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

4 participants