Skillz has the ability to send push notifications to players in order to inform them when their tournaments have finished, their friends have accepted invitations to join Skillz, or other important events happen. These notifications are a Skillz feature that you must take extra steps in order to enable.
It’s important to note that these steps must be followed for each environment, once for production and once for development.
In order to tell the difference between your game’s notifications and Skillz notifications, 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 iOS DevCenter and logging in.
On the right side of the screen, under iOS Developer Program, choose the Certificates, Identifiers, and Profiles button.
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 an APNS certificate for your game.
Important: when making changes to your App ID settings, you need to update all your application’s provisioning profiles.
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 generateto 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:
- Open Keychain Access on your computer.
- Import the certificate you created in the previous step by selecting File -> Import Items.
- Select the Certificates category.
- Select your game’s APNS certificate:
- Select File -> Export Items.
- Save as a Personal Information Exchange (.p12) file.
- You will be prompted to create a password. Make note of this password, as you will need it when you upload to Skillz.
- Save the 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 notifications section of your game in the Skillz Developer Portal upload your file to our servers. Be sure to have the password you encrypted the file with handy when uploading.
p12 files can only be uploaded to the Developer Portal after your game has gone live.
To test your notifications, simply put the username from your game account into our tool and push send!
After following these steps, notifications should work properly between your game and Skillz. Congratulations, you are done integrating the SDK!
Now it’s time to better understand the different types of tournaments offered by Skillz, as well as how to configure them through the Skillz Developer Portal.