How to configure your application for iOS
To configure Pushwoosh for your iOS application you will need the following:
- Apple Push Notification Service (APNS) certificate
- private key for the certificate
- password for the private key
The process might look a bit complicated but actually it is not that hard to do.
1. Generating a Certificate Request
The first step to using the Push notifications is to generate a certificate request file that you can use to request a development SSL certificate later on.
1. Launch the Keychain Access application in your Mac OS X.
2. Select Keychain Access→Certificate Assistant→Request a Certificate From a Certificate Authority (see Figure 1):
Figure 1. Generating a certificate request
3. Enter the information required and check the Saved to disk option. Click Continue (see Figure 2).
Figure 2. Saving the certificate request to disk
4. Save the certificate request using the suggested name and click Save (see Figure 3): Click Done in the next screen.
Figure 3. Naming the certificate request
2. Creating an App ID.
Each iPhone applications that uses the APNs must have a unique application ID that uniquely identifies itself. In this step, you will learn how to create an App ID for push notification.
1. Sign in to the iOS Developer Center at: http://developer.apple.com/iphone/. Click on the iOS Provisioning Portal on the right of the page (see Figure 4).
Figure 4. Launching the iOS Provisioning Portal
2. You should see the welcome page (see Figure 5).
Figure 5. The welcome screen of the iOS Provisioning Portal
3. Click on the App IDs tab on the left and then click on the New App ID button (see Figure 6).
Figure 6. Clicking on the App ID tab
4. Enter your Application Name (Ex: “PushAppID”) for the Description and select Generate New for the Bundle Seed ID. Provide the correct Bundle Identifier in the form com.company.application (Ex: com.arellomobile.MyPushApp). Click Submit (see Figure 7).
Figure 7. Creating a new App ID
5. You should now see the App ID that you have created (together with those you have previously created) (see Figure 8).
Figure 8. Viewing the newly created App ID
3. Configuring an App ID for Push Notifications
Once an App ID is created, you need to configure it for push notifications.
1. To configure an App ID for push notification, you need to click the Configure link displayed to the right of the App ID. You will now see the option (see Figure 9).
Figure 9. Configuring an App ID for push notification service
Check the Enable for Apple Push Notification service option and click the Configure button displayed to the right of the Development Push SSL Certificate.
2. You will now see the Apple Push Notification service SSL Certificate Assistant screen. Click Continue (see Figure 10).
Figure 10. The Apple Push Notification service SSL Certificate Assistant screen
3. Click the Choose File button to locate the Certificate Request file that you have saved earlier. Click Generate (see Figure 11).
Figure 11. Generating the SSL certificate
4. Your SSL Certificate will now be generated. Click Continue (see Figure 12).
Figure 12. The APNs SSL certificate that is generated
5. Click the Download Now button to download the SSL Certificate. Click Done (see Figure 13).
Figure 13. Downloading the certificate generated
6. Download the certificate and double-click on it to install it in the Keychain Access application (see Figure 14). This is the SSL certificate that will be used by Pushwoosh so that it can contact the APNs to send push notifications to your applications. Now you need to export the certificate.
Figure 14. Installing the generated certificate into the Keychain Access application
4. Exporting Private Key
1. Open up the Keychain Access Application and select the ‘Keys’ category.
Click on the private key associated with your iOS Push Certificate and click ‘Export Items’ in the menu (see Figure 15).
You will be prompted to create a password, you will need to enter the same password on Pushwoosh configuration page.
Figure 15 Exporting Key file
8. To install the Certificate and the Private Key for the application log in to your control panel on www.cp.pushwoosh.com, enter “My applications”, select the application, click on the “Edit” button near the iOS icon (see Figure 16).
Figure 16 Clicking edit properties Icon to install the Certificate and the Private Key
9. Pushwoosh provides two ways to configure push notifications through the Control Panel: Manual and Automatic.
9.1 To use Manual configuration form click “Manual” button and upload the certificate and the private key (remember those two files we have created few steps above?) from your computer. Make sure you select the correct gateway: Sandbox for Development certificates and developer app builds or Production (aka Distribution) gateway for AdHoc and AppStore builds, enter your “Private key password” and click “Save” (see Figure 17).
Figure 17 Uploading Certificate and Private Key files (Manual configuration)
If you want to switch gateway for Pushwoosh from Sandbox to Production (for example), check “Production” in the bottom and upload the correct Certificate and Private Key for the production environment.
9.2 Automatic push notifications configuration. (available for Premium accounts)
To use Automatic configuration form click “Auto” button and follow the next steps:
1. Enter your Apple ID and Password
2. Select your Developer team
3. Select your App ID
4. Select the gateway you want to configure: Sandbox for developer app builds, Production (aka Distribution) gateway for AdHoc and AppStore builds
5. Make your Provisioning profile push compatible
Figure 18 Automatic push notifications configuration