I am trying to share common data between my iPhone app and its extension app on Apple watch. Like the following:
//set
NSUserDefaults *groupDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.appName"];
[groupDefaults setObject:someArray forKey:@"someArrayKey"];
[groupDefaults synchronize];
//get
NSUserDefaults *groupDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.appName"];
NSArray *someArray = [groupDefaults objectForKey:@"someArrayKey"];
I also turn on App Groups both for the iPhone and Apple Watch apps. I have also modified the app id to support this and generated a new provisioning profile.
But the content of someArray , is different when running on the Watch and on the Phone.
Like on the Watch I see only the data I store from the watch, and the same on the Phone.
what is missing here?