Search code examples
iosnsuserdefaultsios-app-group

How to register Settings.bundle keys on shared defaults


I am trying to link settings properties with the app. I managed to do it using standardUserDefaults. The problem is that my app have and extension and I need to use Shared Defaults with a SuiteName.

Although I use the same register method on shared defaults, the properties changed in the settings bundle are not updated in the app.

I want to ask first if this is possible. And if so, how is the way to achieve it.


Solution

  • Add the ApplicationGroupContainerIdentifier key to the Root.plist file of your Settings-Watch bundle.

    https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/Settings.html