I also have a Mac App Store app that uses the 'Mac style' group I'm going to update. I'm looking for advice on how I should proceed. Xcode nudged me to toggle "Register app groups" and now I have the old identifier listed in "app groups" for all target and it is in red text.
So if I hit the + and make a new identifier with the group. prefix, am I supposed to duplicate the old preferences to new container?
NSUserDefaults *oldGroupPrefs = [[NSUserDefaults alloc]initWithSuiteName:@"oldcontainerid"];
NSUserDefaults *newGroupPrefs = [[NSUserDefaults alloc]initWithSuiteName:@"newcontainerid"];
// save the values from oldGroupPrefs to new?
Documentation states:
Format the identifier as follows:
group.
Apple ensures that the group name you choose is unique when you register the app group on the Apple Developer website. For more information, see Register an app group.
In macOS, you can also create app groups or add apps to existing app groups using this identifier format:
.
You don’t need to register app groups that use this format on the Apple Developer website.
So I'm confused. Docs state using the old format is okay..
In the App Groups working towards harmony post:
Without that, you can’t submit an app that claims both styles of app group ID to the Mac App Store.
[...]
It is possible to work around this limitation, but it requires ‘heroic’ measures. The trick is to split your code into a main app and a helper, with the main app only claiming the iOS-style app group ID and the helper only claiming the macOS-style one. Your main app can then call on the helper to do the necessary work, for example, to access the app group container for the macOS-style app group ID.
I don't want to do this. I don't have a Catalyst app and I only need one group to write shared preferences in. So I don't really need to do this....unless it is going to be enforced policy. Migrating data from a container is annoying enough but having to migrate from a helper tool seems kind of insane.