defining an app group shared between macOS and iOS

My understanding is that iOS app group names must begin with "group.", but macOS group names must begin with the team identifier.

If I check a "group." name in the iOS section, it's also added to the macOS section, despite being invalid.

If I add a "team-id:" name in the macOS section, it's also added to the iOS section, and marked in red as invalid. If I uncheck it from the iOS section, it also gets removed from the macOS section.

Is there a way to define the equivalent group names in the two sections?

Xcode 14.1b3 screenshot:

Replies

This is a complex topic. One day I’ll get around to fixing the documentation for this (r. 92322409) but today is not that day )-:

Some factoids about macOS and app groups:

  • macOS does not, in general, require that app groups be authorised by an entitlement.

  • The exception here is for sandboxed apps. To access on app group from a sandboxed app, your app must authorise that access by listing it in the com.apple.security.application-groups entitlement.

  • Your claim to that entitlement does not need to be authorised by a provisioning profile. Specifically, in the terminology defined by TN3125 Inside Code Signing: Provisioning Profiles, it is an unrestricted entitlements.

  • The App Store checks the app group’s claimed by your app during the App Review process.

So:

  • If your macOS app is not sandboxed, you can use any app group ID you like, including one using the group.GGG convention used by iOS.

  • If your app is sandboxed, your app group ID must be backed by an entitlement.

  • If you submit that to the Mac App Store, your app group ID must ‘belong’ to you. That means that you must either follow the macOS convention (TTT.GGG, where TTT is your Team ID) or the iOS convention (group.ggg, where that group ID is registered to your team on the Developer website).

Share and Enjoy

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

  • Thanks Quinn, I read your earlier replies on this subject, which were helpful. In this case, I can get by with only using an application group on the iOS side. But it's unclear to me how the existing Xcode interface (screenshot above) can be used to specify an app group for for a suite of iOS apps and sandboxed macOS apps.

  • Hello. I have the same problem. I am building a multi-platform app with SwiftUI and I want to use group on iOS and $(TeamIdentifierPrefix) prefix on macOS. However, I can't seem to set them individually. I am using Xcode - RC2 Version 14.1 (14B47b). Is there a way to set each of these?

  • For a more detailed explanation of this issue, see App Groups: macOS vs iOS: Fight!