ΩlostA
ΩlostA

Reputation: 2601

Xcode: How to select two different App Groups for two different targets pointing on two different team account (Enterprise & Company)

I have two different targets, and I try to get two different groups to each targets. My goal is to have two different versions, one for the App Store, one for distribution. I installed the push notification that worked well until now for the Company version, but, as I created the enterprise provisionning, xcode refuse to put different groups for this two targets (in the Capabilities/App Groups section)

Target Enterprise: Target Enterprise enter image description here
Target Company (for Apple Store)
Target Company (App Store) enter image description here

How to get this two targets with two different groups? (Xcode change me automatically for the target GMP_app_ios, if I change the group of the target GMP_app_ios AppStore and vice versa).

Upvotes: 3

Views: 2846

Answers (1)

Bojan Dimovski
Bojan Dimovski

Reputation: 1216

Since you have a duplicated target, the issue is that the second target uses the same entitlements file as the original one (check the official documentation for more info).

You can do a quick fix, which would be to duplicate the entitlements file and update the Code Signing Entitlements (CODE_SIGN_ENTITLEMENTS) value under Build Settings.

A long term solution would be to migrate the project to using xcconfig files, having a single target with different configuration pairs (Debug and Release) for each environment (Enterprise and Company in your case). A good starting point would be the Let's Set Up Your iOS Environments blog post.

Also, note that the values in the entitlement files must correspond to the values in the App ID configuration on the developer portal.

Upvotes: 12

Related Questions