Shared NSUserDefaults on tvOS?

Can I share data between my TVServices extension and the parent app using an App Group and shared NSUserDefaults (initWithSuiteName:)?

Yes. Are you looking for more information than that?

Thank you.

Do you know if it is safe, or is it subject to be purged like other local storage?

The docs suggest you can store a couple hundred KB of data in a shared NSUD suite.

Does this work for a Settings bundle? I tried to define my App Group in the setting bundle so both my extension and main application could read the settings, but it didn't work.


As a failover, I read from the settings bundle when the app launches and write the data to NSUserDefaults. Then my extension can read that via App Groups.

Shared NSUserDefaults on tvOS?
 
 
Q