So I am working with a few other developers on an iOS app that has push notifications enabled. We have a provisioning profile that supports push and we each have our own developer certificates with which to sign the code. All standard stuff from what I understand.
The problem we are running into is that Xcode requires to you pick a dev cert in the Project and/or Target setting (under Code Signing Identity) when you want to run the app on a phone. If I pick my dev cert and check that change into git, then it won't work on anyone else's development environment because they don't have my cert in their keychain. So everybody is constantly changing the project file so it works with their cert.
Is there no way around this? I realize there is the automatic profile selection option, but that doesn't work with push notifications. If you try that you get the error
Failed to obtain push notification token: Error Domain=NSCocoaErrorDomain Code=3000
"no valid 'aps-environment' entitlement string found for application"
when the phone tries to register to receive its push token.
Surely this has been solved. How does this work?
Make a separate build configuration for each developer and push that once, then have each developer create his own scheme that uses their build settings. Schemes don't go into project folder and will not be messed around with by git.
Here is a step-by-step guide:
Create a copy of your "debug" build configuration, name it as you want:

Set your desired code signing settings for your new configuration:

(at this point you can commit/push your changes, following steps will not affect project file) Create a new scheme, name it as you want:
Select your build configuration for "Test" (and/or any other cases, just add new configurations for them):

Make millions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With