Push Notifications

Notifications

Push Notifications are a Skillz feature that you must take extra steps to enable. In order to tell the difference between your game’s notifications and the notifications sent by Skillz, you can look in the dictionary of the notification payload. If it contains a property for SKZVersion, then you know it is a Skillz notification.

 

Step 1: Enable push notifications in your game

Start by going to Apple’s Developer Portal and logging in.

On the right side of the screen, under iOS Developer Program, choose the Certificates, Identifiers, and Profiles button.

Screen_Shot_2017-08-30_at_4.22.10_PM.png

 

On the next page, choose Identifiers. This brings you to all of your App ID’s. Edit the App ID for your game and enable push notifications.

 

Follow Apple’s steps to create a production APNS certificate for your game.

Screen_Shot_2017-08-30_at_4.25.10_PM.png

 

Important: when making changes to your App ID settings, you need to update all your application’s ProvisioningProfiles.

For more detailed information about Provisioning Profile, refer to the Apple local and push notification programming guide.

After adding a certificate, the affected profiles in the Provisioning Profiles section will be marked as invalid. Hit edit and generate to recreate the Provisioning Profile.

 

You will also need to update your XCode project settings with the newly-regenerated Provisioning Profile. Later, when you create the binary for distribution, you will need to ensure that it uses the correct profile.

Also ensure that your Provisioning Profiles are not signed with a wildcard app ID. For example, “com.skillz.*” would not receive push notifications. You must use a specific app ID, like “com.skillz.diamondStrike”.

Lastly, Make sure that you have turned on Push Notifications inside the Capabilities tab of your target app.

 

Step 2: Create a p12 out of your certificate

Once you have your APNS certificate created you will need to package the certificate and the corresponding private key in a p12 file. For security reasons, we recommend you do not use this private key for anything besides creating the initial CSR file that was used to create the certificate.

If you are creating a p12 on a Windows machine, follow this tutorial from Adobe instead.

To create a p12 file:

  1. Open Keychain Access on your computer.
  2. Import the certificate you created in the previous step by selecting File -> Import Items.
  3. Select the Certificates category.
  4. Select your game’s APNS certificate:Screen_Shot_2017-08-30_at_4.33.07_PM.png
  5. Select File -> Export Items.
  6. Save as a Personal Information Exchange (.p12) file.
  7. You will be prompted to create a password. Make note of this password, as you will need it when you upload to Skillz.
  8. Save the p12 file in a secure place so that you can retrieve it later.

 

Step 3: Upload the p12 to our website

The final step to enable Skillz notifications in your game is to upload the newly-created p12 file to Skillz. Go to the Push Notifications section of your game in the Skillz Developer Portal and upload your file to our servers. Be sure to have the password you encrypted the p12 file with available when uploading.

To enable push notifications before launching your game, you can configure them on the push notifications screen shown below.

Push_Notifs.png

 

To change your push notification settings in a game that is already live,  go to your Game Dashboard and click the edit button next to the game you wish to update. Then click Push Notification on the left hand sidebar to access the screen you see below.

Push_notifs_2.png

 

Step 4: Test and verify 

Note: You can only test Skillz push notifications with your Skillz environment set to production.

Push notifications can be tested on the verify configurations screen for games that are not yet launched.

oush_notifs_3.png

For live games, this can be found at the bottom of the push notifications screen as outlined in Step 3.

To send a test notification, enter the username of the user who you would like to receive the notification and click Send Test. The user must be logged into the game on an iOS device and have enabled push notifications in their settings in order to receive your test push notification. It may take a few minutes for the user to receive the push notification, which will include a random 6-digit code. Please enter the code into the 2nd field on the screen and click Verify to finish the verification process.

Screen_Shot_2018-01-19_at_9.57.13_AM.png

 

The image below shows an example of a push notification containing the 6-digit verification code.

IMG_7471.PNG

If you are not receiving any push notifications, make sure you have enabled notifications in your app by going to your iOS device's Settings -> Notifications, selecting your app and toggling on Allow Notifications.

IMG_7472.PNG

 

If you have any questions or require assistance, please reach out to integrations@skillz.com