Kinda stumped by this. I'm working on an Xcode extension that needs to communicate with its container app via NSUserDefaults. To do this, you need to set up an app group entitlement in both the extension and the container app, sign your app, then initialize the defaults like so...
let defaults = UserDefaults(suiteName: "group.com.MyCo.TestCode")!
The problem is even though no errors are thrown, the extension and the app get two distinct copies of the defaults.
However, if I go back and when adding the group, leave the TeamIdentifierPrefix in place, I end up with a group name of this instead...
"03V7NBU5AX.group.com.MyCo.TestCode"
Which I use in the initialization like this...
let defaults = UserDefaults(suiteName: "03V7NBU5AX.group.com.MyCo.TestCode")!
...and now everything works! But why didn't the first case work? Every tutorial I've seen says as long as the app groups match it should work, and not a single tutorial I've seen mentions the team identifier prefix. Is this something specific to Xcode extensions?