Can't get app group capability for macos in a Multiplatform app

I am in the process of creating a multiplatform app with a shared code base using swiftUI for iOS and mac. This app has a widget extension target for both iOS and mac and a helper app for mac only. I am trying to share data and userdefaults between the main app and the widget extension for ios, and for the mac share data between the main app, widget extension and the helper app.

I have setup an app group container to share data between all targets. However this is only working on iOS. The app group capability is not extended to macOS.

I have been researching for weeks now and all the answers I can find are for if the macOS were a different target, which would entail me having the macos group container prefixed with my team identifier.

With a multiplatform app, the main app simply won't let me prefix the group container with my team identifier. Which unfortunately xcode prevents me from doing for a multiplatform app.

I have no idea of how to solve this issue and any help will be appreciated.

Answered by DTS Engineer in 802519022

Yeah, this is annoying. To start, I recommend that you read App Groups: macOS vs iOS: Fight! for a bunch of backstory.

In the multi-platform app case, I don’t think that the Signing & Capabilities editor is up to this task. I’m pretty sure we have a bug against Xcode about this already, but it wouldn’t hurt for you to file your own. If you do, please post your bug number, just for the record.

I’m not entirely sure of the best way to resolve this. I think you might end up needing a platform-specific .entitlements file, but I’ve not had time to sit down and test that.

Share and Enjoy

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

Yeah, this is annoying. To start, I recommend that you read App Groups: macOS vs iOS: Fight! for a bunch of backstory.

In the multi-platform app case, I don’t think that the Signing & Capabilities editor is up to this task. I’m pretty sure we have a bug against Xcode about this already, but it wouldn’t hurt for you to file your own. If you do, please post your bug number, just for the record.

I’m not entirely sure of the best way to resolve this. I think you might end up needing a platform-specific .entitlements file, but I’ve not had time to sit down and test that.

Share and Enjoy

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

I'm having this issue as well and not sure how to move forward. The app works on macOS 14 fine, on macOS 15 my testers are getting:

This is a multi-platform SwiftUI based app that I plan on supporting iOS 17/18 and macOS 14/15. They both need shared app group containers to function. How do I configure this correctly in Xcode?

Thanks! – Zach

Does your Mac app ship on the Mac App Store? Or do you distribute it directly using Developer ID signing?

Share and Enjoy

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

Thank you for your recommendation of reading about App Groups. I decided to try creating separate targets for IOS and MacOS with separate app groups for each platform. It seemed to work till I realized that widget extensions will be an issue. I can't use the same widget extension between both platforms because of the app group issue. And I can't create multiple widget extensions because it seems like there can be only one widget bundle. I'll have to look into the platform-specific .entitlements like you mentioned, but I fear that I will still run into the same widget extension problem mentioned above even with platform specific .entitlement files.

This app is currently in beta through TestFlight, but will be distributed through the App Store on both platforms.

This app is currently in beta through TestFlight, but will be distributed through the App Store on both platforms.

If you ship via the Mac App Store, you have the option to use an iOS-style group on all platforms. That’s the first option listed in the System Integrity Protection section of the macOS Sequoia 15 Release Notes.

I decided to try creating separate targets for IOS and MacOS with separate app groups for each platform.

A separate target will work, but I can easily imagine it causing follow-on problems, like the one you’ve already hit. My best suggestion right now is to use a conditional .entitlements file build setting. Folks have reported success with that approach in another thread.

Share and Enjoy

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

Can't get app group capability for macos in a Multiplatform app
 
 
Q