mike
mike

Reputation: 2193

Provisioning Profiles With Multiple Schemes & Push Notifications

I followed the following article to enable the same app to be installed on the same device multiple times for each environment (dev, uat, release):

https://medium.com/@danielgalasko/run-multiple-versions-of-your-app-on-the-same-device-using-xcode-configurations-1fd3a220c608

I've run into an issue I'm not sure how to fix. We now have a unique bundle ID for each environment. We need to distribute each flavour of the app to users so we need both a distribution and a development provision profile. Because we have multiple schemes each with their own bundle ID we need provisioning profiles for each scheme (can't use wildcards due to push notification entitlement). I'll need to check in the distribution provisioning profiles to our repo as we use bitrise for CI and it'll need a distribution prov profile to archive the app, so each time we want to cut a local build and run it on device we'll need to change the provisioning profile to the dev variant and remember to not check those changes in to the repo.

This seems a bit backwards, is there a more efficient way to handle this scenario?

Upvotes: 2

Views: 1364

Answers (2)

codelover
codelover

Reputation: 1139

  1. I would recommend that you just create the APP ID individually for all schemes required in your Apple Enterprise / Developer Account.

  2. Then just make sure all the APP ID are enabled with Push notifications for the Development and Distribution both. Distribution is sufficient i suppose.

  3. Now in your Xcode let the Option in all schemes be set to Automatic provisioning so you get rid of a headache to make profiles in Account always, Xcode will handle this.

  4. Now tell your server guy to handle .p12 for APNS Distribution cert smartly with passwords set for each and trigger push for each app it should be okay. Make sure he selected SANDBOX if its Development APNS cert given, or LIVE Mode if its Distribution cert was given.

Upvotes: 0

dpassage
dpassage

Reputation: 5453

One way to handle this is to encode the settings needed to build each "version" of your app into a command-line tool for building. fastlane is pretty much the canonical tool for this. You can set up multiple "lanes" which will build your app using different schemes and/or provisioning profiles. It also has a mechanism which lets you store your provisioning profiles in a separate, encrypted git repo.

My experience has been that it can be a bit fiddly to get right, especially if you're using a CI service for builds, but once you have it working it's easier to make sure you're building the right binary with the right options.

Upvotes: 1

Related Questions