I'm trying to share the keychain of my main app with an app extension.
In both places my entitlements are added to the main app target and my extension, both with the values "$(AppIdentifierPrefix)com.example.MyGroupName"
I followed this [great] post on https://forums.developer.apple.com/message/75928#75928 to debug the issue and found the following:
<key>ApplicationIdentifierPrefix</key>
<array>
<string>SomeIdentifier1</string>
</array>
Of my mobileprovision.
Whereas my extension expects the Team ID.
How do I correct one of these so they both are using the same access group?
It sounds like your app was created back in the day, where each app would get its own unique App ID prefix. That’s still supported for existing apps, but new apps always use the Team ID. You can learn more of the backstory to this in Technote 2311 Managing Multiple App ID Prefixes.
With regards keychain sharing, I don’t think there’s a way to set that up between two apps with different prefixes (in this context you can think of your app extension as an app). The solution is to migrate your app to use a Team ID prefix, but that’s not without its drawbacks. TN2311 goes into the details.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"