App Group ID access for files after transfer ios

I have some questions regarding App Group Id's and use of the FileManager during an Appstore iOS transfer.

I've read a lot of the topics here that cover app groups and iOS, but it's still unclear exactly what is going to happen during transfer when we try to release an updated version of the app from the new account.

We're using this method FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.foo.bar") to store files on the device that are important for app launch and user experience.

Once we transfer the app and begin the process of creating a new version under the new account will we be able to read the files that are stored using this app group id under the new account?

What steps do we need to take in order to handle this and continue being able to access these files? It seems like the app group is not transferred in the process?

I've seen some users mention they removed the app group from the original account and created it again under the receiving account (with notes mentioning this is undocumented behavior). These conversations we're centered around Shared user defaults, and that applies as well but I'm more concerned with reading the values from the file system.

Thanks!

Answered by DTS Engineer in 826668022
Written by devmaz in 775264021
Once we transfer the app … will we be able to read the files that are stored using this app group id

No.

App groups are tied to your team and do not transfer when your app transfers.

Written by devmaz in 775264021
I've seen some users mention they removed the app group from the original account and created it again under the receiving account

I’ve seen folks do that as well. I’ve always been reluctant to recommend that approach because it’s not a documented path, and this thread suggests that my concerns were justified.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Written by devmaz in 775264021
Once we transfer the app … will we be able to read the files that are stored using this app group id

No.

App groups are tied to your team and do not transfer when your app transfers.

Written by devmaz in 775264021
I've seen some users mention they removed the app group from the original account and created it again under the receiving account

I’ve seen folks do that as well. I’ve always been reluctant to recommend that approach because it’s not a documented path, and this thread suggests that my concerns were justified.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

It’s better to reply as a reply, rather than in the comments; see Quinn’s Top Ten DevForums Tips for this and other titbits.

I'm curious about other files that might be stored elsewhere

I like to explain this in terms of containers, that is, directories that container content that you can access. Every app starts out with a default app container. Each app group gives it access to a new app group container. When you transfer an app:

  • It retains access to its app container.

  • It loses access to any app group containers.

In terms of the FileManager APIs you mentioned:

  • url(for:in:appropriateFor:create:) returns a URL within the app container.

  • Likewise for urls(for:in:), assuming you pass in .userDomainMask [1].

  • containerURL(forSecurityApplicationGroupIdentifier:) returns a URL to the root of the app group container for the app group ID that you supply.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] The behaviour you get if you pass in other values for the domain mask is complex. This is only useful for non-sandboxed code on macOS. Generally I recommend that iOS apps stick with url(for:in:appropriateFor:create:).

App Group ID access for files after transfer ios
 
 
Q