To send push notifications, you will need to first register your app with the push notification service that corresponds to your app's platform (Apple APNs, Google GCM, or Microsoft WNS). Once you've registered, the service will provide you with a certificate or key that you will need when you create an API BaaS notifier. (See Creating notifiers for more information.)
Push notification services are gateways controlled by platform services (such as Apple and Google). These gateways ensure that push notifications are delivered securely and originate from trusted apps.
To send push notifications to your app on iOS devices, you’ll register the the Apple Push Notification service (APNs). For Android apps, you’ll register with Google Cloud Messaging for Android (GCM).
Before you can send push notifications to your app on iOS devices, you'll need to get set up so that Apple knows you'll be sending notifications. To do that, you'll need to do the following:
- Generate an SSL signing certificate you can use to generate a .p12 certificate.
- Create an Apple App ID through which you can associate push notifications support with your app.
- Generate a .p12 certificate you can use to create an API BaaS notifier. The certificate will be sent to APNs with push notification requests.
For more information see "How the pieces connect" in Getting started with push notifications.
Generating an SSL signing certificate
First, you'll create an SSL signing certificate that you can use to generate a .p12 certificate. To generate an SSL signing certificate, do the following:
- On your development machine, launch the Keychain Access application.
- From the Keychain Access menu, select Certificate Assistant > Request a Certificate From a Certificate Authority.
- Enter a contact email address and a name you will use to sign your apps.
- Select Saved to disk, then click Continue.
- Select Desktop from the Where drop-down, then click Save to download the .certSigningRequest file.
- Click Done once the download has completed.
Creating an App ID
Next, you must create an App ID for your app. The App ID uniquely identifies your app and provides a way for you to configure the app for push notification support.
- Log in to Apple's iOS developer portal.
- In the iOS Apps section, click Certificates, Identifiers, & Profiles, then select App IDs.
- Click the + icon to create a new App ID, and enter the following:
- App ID Description - Name: A unique name that identifies your app.
- App BaaS: Select Push Notifications.
- App ID Suffix: Select Explicit App ID, and enter your desired App ID in reverse-domain format. For example, com.apigee.pushapp.
- Click Submit to create the App ID, then click Done. You will be returned to the App IDs page.
Generating a .p12 certificate
- On the App IDs page, click your new App ID, then click Edit.
- In the Push Notifications section, under Development SSL Certificate, click
- Click Choose File, select the .certSigningRequest file you saved to your Desktop in the previous section, then click Generate.
- Click Done. You will be returned to the App ID settings window.
- In the Push Notifications section, click Download to save the certificate (aps_development.cer file) to your Desktop.
- Double-click the .cer file to install it in your keychain. The newly installed certificate will appear in your Keychain Access application under My Certificates with a name similar to "Apple Development iOS Push Services: <bundle identifier>".
- Control-click the certificate and select Export.
- Save the certificate to your Desktop as a 'Personal Information Exchange (.p12)' file. (You'll need this file when you create a notifier. For more information, see Creating notifiers.
- In the password dialog, leave the password field blank, then click OK.
- In the next dialog, enter your system password, then click Allow.
To create a notifier for sending notifications, you'll need a Google API project and register your app as part of that project. The project's identifier (project number) will become the sender ID your client code will send when registering. Registering your app will give you an API key you'll use to create a notifier. (For more information see "How the pieces connect" in Troubleshooting push notifications.)
To get a key, see the Google documentation on getting started with Google Cloud Messaging.
To register your app with Microsoft WNS, you will need to generate the following with your Window Store Developer Account:
- Identity values: These will be included in the
<identity></identity>elements of your app’s manifest file (package.appxmanifest), and includes
- Package security identifier (SID) and secret key: These will be needed when you create your API BaaS notifier, and will authenticate requests from your app to WNS.
For details, on generating these values, see the Microsoft documentation.