Keychain item sharing between iOS and TvOS apps

Hi,

I've been experimenting for a while now with keychain sharing using an app group. It works really fine between iOS apps.

The iOS apps are synchronized really well using app groups and the data can be read and written on any app in the group.

Now I try to include a TvOS app in the same group, hoping to be able to read/write on the same keychain items accessible on the iOS apps.

It turns out the TvOS app fails to see any item, even if it's in the same app group.

I wonder now if it's supposed to work using an app group, or using a keychain group, or another mechanism.

Anyone had any luck sharing keychain item between iOS and TvOS?

Nope, but could not find any info if this is expected or not. Would be great to get details on that!

I have the same problem. I'm using Keychain Sharing to exchange access token between iOS app watchOS extension and tvOS app. Watches access shared item with no problem. tvOS app fails to find the item in keychain.

I think there may be two different things going on here.

First, we added the following text to the list of caveats in kSecAttrSynchronizable to clarify that synchronizing keychain items through iCloud using this key doesn't work for tvOS:

You can set the kSecAttrSynchronizable key on tvOS, but tvOS doesn’t synchronize your app’s keychain items through iCloud. Items that you store on tvOS never leave the device where you create them, and items that you store on other devices don’t synchronize to tvOS devices.

However, sharing with an application group is something different, and should work on tvOS. That's when you use the App Groups Entitlement to share keychain items among apps from a single developer on a given device. If you distribute two apps through the App Store, and a user installs both of your apps on their iPhone, each of your apps can share keychain items with the other app on that device. To read more about that, see Sharing Access to Keychain Items Among a Collection of Apps.

The two kinds of sharing are independent. You can generally use neither, either, or both. But tvOS doesn't participate in the iCloud synchronization of your app's keychain items.

Keychain item sharing between iOS and TvOS apps
 
 
Q