evgenyneu / keychain-swift

Helper functions for saving text in Keychain securely for iOS, OS X, tvOS and watchOS.
MIT License
2.82k stars 345 forks source link

Not working with accessGroup #100

Open unixb0y opened 5 years ago

unixb0y commented 5 years ago

Somehow, if I try to use the accessGroup feature, I get an errSecMissingEntitlement (-34018) error.
I don't have manual profiles, but use "Xcode Managed Profile" for the Provisioning Profile. ("Automatically manage signing").
I activated "Keychain Sharing" in "Capabilities" and added "com.myname.appname.keychainGroup" which is how I initialise my KeychainSwift object:

let keychain: KeychainSwift = {
    let k = KeychainSwift(keyPrefix: "unixb0y_")
    k.accessGroup = "com.myname.appname.keychainGroup"
    return k
}()

FYI, also in the entitlements file, there is an entry with the correct name.

unixb0y commented 5 years ago

Weird, if I remove the k.accessGroup stuff, my App's share extension actually grabs the key that was set from the main App. At least it works LOL