KeychainAccess
KeychainAccess copied to clipboard
how to pass items from Keychain between iOS project and watchOS extension app
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?
+1, seeing this issue
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/
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