I'm woking on a iOS app that uses App Groups to share data between the app and an extension.
I have three flavours of the app, one for Development, another for Staging and a last one for Production.
I want to define a different App Group for each environment.
What I've done:
- I've created the three App Groups through the development portal.
- I've created three app identifiers, one for each enviroment, and granted access to the right App Group for that environment.
- I've created a Build Configuration for each environment.
- I've created a Build Configuration parameter for the App Group identifier and assigned a different value for each enviroment.
- I've created a parameter in the Info.plist with the value of the parameter in the Build Configuration to be able to access the App Group identifier in the code.
- I'm assigning the right App Group identifier through the code. -I've created a Scheme for building each build configuration, however, all Schemes share the same Project and Targets configuration.
The problem: -When I edit the Target settings, I see the three App Groups there, but only one is selected (the development one) and the same one is selected for all Schemes. I've tried selecting a new App Group for each scheme but as all schemes share the same targets, changing the App Group changes it for all schemes.
Question -As I define whichApp Group to access by code, all three flavours of the app seem to be workikng fine, however, I fear that if XCode regenrates the app identifiers on the development portal it will assign all the flavours of the app access to the same App Group (because that is what is configured in the Target). Am i missing something? How can I have the target settings to point to a different App Group per scheme?