Locksmith
Locksmith copied to clipboard
Keychain Sharing not working between two apps?
Hi have to share keychain between my two apps, for this I have tried following with Locksmith:
- Enable Keychain sharing in capabilities.
- Added common group name TestKeychainGroup.
- Saved my data with Key MyteamID.TestKeychainGroup. It saved success
- Now when i tries to retrieve saved data from keychain with key MyteamID.TestKeychainGroup it is giving nil.
Can anybody tell me, what I forgot to do or it is not supported by Locksmith. Thanks
If you are using default LockSmith setup then your service is setup with this code
public let LocksmithDefaultService = Bundle.main.infoDictionary![String(kCFBundleIdentifierKey)] as? String ?? "com.locksmith.defaultService"
It means it is getting the service name from kCFBundleIdentifierKey which is different for every app and extension. You must set it to same value either editing the source code of LockSmith.swift or using long notation by explicitly setting the service in the function calls. I also made the same mistake and wasted an hour lol