To deploy Push Notifications or GCMs (Google Cloud Messaging), you need to upload a certificate or API Key to the Tapjoy dashboard. Separate configurations are needed for iOS and Android. This document explains how to create and upload the necessary certificate.
1. iOS Certificate
To enable Push in your application and generate your certificate file, please follow the instructions below. For further details visit Apple’s developer site here.
Go to [Apple Developer Site > Certificates, Identifiers & Profiles > iOS Apps > Identifiers > App IDs > Application] to download Production SSL Certificate file for Apple Push Notification service.
In order to upload the downloaded aps_production.cer file to Tapjoy, you must first convert it to a .pem file.
- Double click the aps_production.cer file icon to add the file to Keychain Access.
- Right-click the added certificate and export it as aps_production_cert.p12 file.
From the command line, enter the following command to convert the .p12 file to .pem.
openssl pkcs12 -clcerts -nokeys -out aps_production_cert.pem -in aps_production_cert.p12
- Export the Private Key used for the certificate just the same and save it as aps_production_key.p12.
From the command line, enter the following command to convert the .p12 file to .pem:
openssl pkcs12 -nocerts -nodes -out aps_production_key.pem -in aps_production_key.p12
- From the command line, enter the following commands to combine the certificate and Private Key files into one .pem:
openssl rsa -in aps_production_key.pem -out aps_production_key_noenc.pem cat aps_production_cert.pem aps_production_key_noenc.pem > apn_production.pem
Now, upload the resulting apn_production.pem file to: [Game/App > Setting > Push > Certificate].
2. Android Certificate
To use GCM, you need to obtain a server key from the Google Cloud Console. If you haven’t configured GCM in your project, refer to Getting Started with GCM.
To enable the GCM service:
- In the sidebar on the left, select APIs & auth.
- In the displayed list of APIs, turn the Google Cloud Messaging for Android toggle to ON.
- From Overview, you can obtain the Project Number(e.g. 136515230000). This value is required for calling Tapjoy.setGcmSender for 5Rocks SDK integration.
- Create a new application from APIs & auth > Credentials apps, if you don’t already have one. From here, you can obtain the Server Key. Make sure “Any IP address is allowed” and upload this Server Key to [Game/App > Setting > Push > Certificate]