Let's get going! The very first step is to go to the dashboard and create your mobile app.
Once your app is created, you'll find the API keys needed to set up the SDK in ⚙ Settings → General:
Now let's generate your Push certicates and upload them to Batch's Dashboard. If you already have valid certificates, you can jump to the next step.
These API keys must not be mistaken for the APNS environment Batch will output to the Xcode logs when starting. The environment depends on the app's provision, not on the Batch API Key used.
Batch servers need to have a certificate in order to communicate with Apple Push Notification Services (APNS). This certificate is generated for an unique Application Identifier (App ID).
Open your Keychain application on your Mac. In the menu bar, select "Keychain Access" → "Certificate Assistant" → "Request a Certificate From a Certificate Authority…"
Then, enter your information in the required fields and select "Saved to disk". Save the "CertificateSigningRequest.certSigningRequest" file to your Desktop.
Head to the Apple Developer Member center and create a new App ID (or choose an existing Explicit App ID) to configure Push Notifications. Select it from the list, then click on "Edit".
Scroll down to the Push Notifications section.
Under "Production SSL Certificate", click on "Create Certificate...". The Production certificate is capable of pushing both sandbox and production environments.
The next screen will show instructions for creating a Certificate Signing Request (CSR).
Select "Choose File…" and locate the .certSigningRequest file on your desktop. Finally, select "Generate" and download the generated SSL certificate from the "iOS App ID Settings" screen.
Now you have the certificate, you need to have it with its key bundled into a .p12 file format.
First, add the certificate to your Keychain by double clicking on the downloaded SSL certificate.
In Keychain Access, under "My Certificates", find the certificate you just added. It should be called "Apple Push Services:".
Certificates called "Apple Production IOS Push Services" and "Apple Development IOS Push Services" are not supported anymore. Please generate a new Production Certificate
Right-click on the certificate, select "Export Apple Push Services:…", and save it as a .p12 file.
You will be prompted to enter a password which will be used to protect the exported certificate.
If the Personal Information Exchange (.p12) option is grayed out in the export sheet, make sure "My Certificates" is selected in Keychain Access.
Now go to Batch's dashboard → ⚙ Settings → Push settings, and upload your P12 certificates.
If you're having trouble uploading your certificate, you can check our troubleshooting documentation.
After creating a new App ID or modifying your existing one, you need to (re)generate your provisioning profile and build with it.
Go to Apple Developer website, then click on "Provisioning Profiles" from the iOS Apps section.
Click on the "+" button to create a new iOS Provisioning Profile or select an existing one.
If you already have one, make sure it has Push Notifications in the Enabled Services field.
In the Provisioning Profile creation wizard:
Then download the generated provisioning profile from the next screen by selecting the "Download" button.
Install the profile by double-clicking on the downloaded file.
Your new provisioning profile should appear in the Provisioning Profiles section in your Xcode settings under the "Accounts" section. Make sure that your developer certificate is installed in your Keychain.
Batch Push campaigns are sent to both the apps built with your Development and the Distribution provisioning profile.