Setting up APN for iOS Push Notification
You can send Push Notification to your user's devices via Skygear Push API or CMS Push Manager. Skygear uses the Apple Push Notification(APN) service to send push messages to client iOS applications.
To enable sending Push Notifications through APN, you need to:
- Install Skygear iOS SDK on your app. Learn how to install SDK if you haven't.
- Set up Apple Push Notification Authentications in Skygear Portal
- Have a provisioning profile for the App ID of your testing app
There are TWO ways setting up Apple Push Notification Authentications:
- Use Token-base Auth
- Upload Push Certificate and Key
These credentials can be obtained from Apple Developer Member Center > Certificates, Identifiers & Profiles.
We recommend Token Base Authentication which involves less steps. However we will guide you through both ways.
Option 1: Using Token-base Auth
Skygear Push Notification can use Apple Push Notification Authentication Key to send Push Notifications to the application identified by the App ID.
Obtaining an Auth Key and Team ID
You may find the Team ID at membership area at member center.
Then you can obtain an Apple Push Notification Auth Key. Click + on the Keys -> All page in your developer center,
Enter a name for your key, enable APNs
and click Continue at the bottom of the page.
Finally click Confirm at the bottom of the page, and you can download the .p8
file as the Auth Key for the Skygear Portal, and also write down the Key ID.
Setting the credentials on Skygear Portal
First, enable APN in Skygear Portal: App > Push Notification > Apple Push Notification (APN)
Please turn on the Use Token-based Apple Push Notification option to enable using Auth Key.
Now, specify the Team ID, Auth Key ID and upload the Auth Key file in the corresponding fields.
Click on Update button to apply changes.
To send message to apps that are already on App Store you need to turn on Send Push Notification in Production Environment
.
Option 2: Uploading Push Certificate and Key
You will need to upload the followings to enable APN:
- Push Certificate
- Private Key for the Certificate
Obtaining the Apple Push Notification Service certificate
You can request an Apple Push Notification Service certificate from the Apple Developer Member Center.
Skygear requires the certificate and private key files in PEM format. Please follow this guide in detail to generate PEM files for your key.
Setting the credentials on Skygear Portal
First, enable APN in Skygear Portal: App > Push Notification > Apple Push Notification (APN)
Then, upload the Apple Push Notification Service certificate and private key file.
Provisioning profile for Apps under Development
To test your Apps under development which is not on App Store yet, you will need a Provisioning Profile for the specific App ID.
- Go to the Apple Developer Member Center.
- Go Certificates, Identifiers and Profiles and select Provisioning Profiles > All.
- Click the + button to create a new Provisioning Profile.
- Select iOS App Development as provisioning profile type, then click Continue.
- In the drop down menu, select the App ID you want to use, then click Continue.
- Select the iOS Development certificate of the App ID you have chosen in the previous step, then click Continue.
- Select the iOS devices that you want to include in the Provisioning Profile, then click Continue. Make sure to select all the devices you want to use for your testing.
- Input a name for this provisioning profile, then click Generate.
- Download and open the Provisioning Profile file to install it on your Mac for Xcode Development.