Quinn, in your post "App Groups: macOS vs iOS: Fight!", you mention that an app must meet at least one of four criteria to access an app group container without user intervention:
- Your app is deployed via the Mac App Store (A).
- Or via TestFlight when running on macOS 15.1 or later (B).
- Or the app group ID starts with your app’s Team ID (C).
- Or your app’s claim to the app group is authorised by a provisioning profile embedded in the app (D) [1].
Our app is distributed directly (Developer ID), so it doesn't meet the first two criteria. We already had the app group ID set up to match the iOS ID (without our Team ID) and changing it now would affect our users already-stored data, so criteria C isn't really an option either.
That brings us to criteria D. We've added the App Groups Capability to our App ID on the Developer site and creating a Developer ID provisioning profile with this App ID. However, for some reason the App Group Capability is not included in the provisioning profile.
How then do we go about satisfying criteria D ("your app’s claim to the app group is authorised by a provisioning profile embedded in the app (D)")?
If this is impossible, how can we migrate our user's data away from the affected container?
Right now you can’t )-: Only the Developer website can issue valid provisioning profiles, and it won’t issue a Mac profile that authorises the use an app group.
This is a source of ongoing grief for a bunch of developers like yourself. We really want to fix it, but I don’t have any info to share as to when that’ll happen.
There’s no ‘silver bullet’ solution here; the obvious answer is the answer:
-
On the first launch of your new version, detect whether the user has previously run the old version.
-
If they have, and you haven’t already done the migration, ask the user whether they want to migrate.
-
If they do, copy your files from the iOS-style app group container to the macOS-style one. This will require user approval, but you can warn the user about this in step 2.
Oh, and this is only complex on macOS 15. If the user first runs the new version of your app on an older system, you can just do step 3 without asking.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"