App Groups: How to use group. prefix and Team ID prefix for Multiplatform apps?

Hi there,

I have a Multiplatform app with just one app target with an iPhone, iPad and Мас Destination. On the Mac my app is a developer singed App that is being distributed outside of the Mac App Store.

I want to use App Groups, but as long as there are multiple destinations, Xcode only allows Group Identifiers starting with group.. However, for macOS I need to have a group ID that starts with the TeamID as explained here.

So I created two separate entitlements, which are identical, but with different group IDs:

With Automatic Code Signing enabled, I get this warning:

Xcode still seems thinks it has to use the macOS Group ID for the iOS version. In the App Groups section, the mac Group ID is red and the iOS Group ID is not checked.

The app builds and runs without issues on all platforms. The App Store Connect validation (for the iOS version) also works without any errors.

Am I doing something wrong? Do I need a separate Mac target because Xcode does not support separate Group IDs for Multiplatform apps?

Thanks, Rico. Unfortunately, CloudKit can’t replace the app group for my use case, so I’ll need to separate the targets. Hopefully, future versions of Xcode will eliminate the need for this workaround.

@Iomegano updated answer:

If you are using App Groups, you can make separate entitlements files for each platform to correctly configure the App Groups for iOS vs MacOS. Alternatively, you may want to explore CloudKit's offerings as they will not require the same division of targets to work on each platform.

Rico


WWDR | DTS | Software Engineer

App Groups: How to use group. prefix and Team ID prefix for Multiplatform apps?
 
 
Q