I have an iOS application project with 2 separate target
s. For example target A and target B. Now in xCode8
when I turned keychain sharing
to ON the Xcode generates two A.entitlements
and B.entitlements
files. Unexpectedly both of them have the same value like this:
<plist version="1.0">
<dict>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)target1.bundle.identifier</string>
</array>
</dict>
</plist>
I mean in both of the file uses bundle identifier
of my first target; and When I manually try to change the value for one of them the other one changes too.
As you know the Xcode will not sign the app while the value in keychain-access-groups
exactly match the bundle identifier of the provisioning profile you use for sign.
So I am wondering how we can have two separate values for two separate entitlements files of two separate targets?
App groups allow multiple apps produced by a single development team to access shared containers and communicate using interprocess communication (IPC). Apps may belong to one or more app groups. For iOS, format the identifier as follows: group.<group name>
Keychain Services help you to securely store items, or small chunks of data, into an encrypted database on behalf of the user. From Apple's documentation, the SecKeychain class represents a database, while the SecKeychainItem class represents an item.
I finally fixed this by using below code in my entitlements:
<plist version="1.0">
<dict>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</plist>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With