Deliver mobile push notifications with Apple Push Notification service
To deliver push notifications from your iOS app you need to register a new auth key for the Apple Push Notification service (APNs). MagicBell will use P8 tokens to authenticate requests made to the APNs.
Follow these steps to register a new key:
- Login to your Apple developer account and open the keys page (you have to enroll in Apple's Developer Program, before).
- Register a new key, make sure you enable "Apple Push Notifications service (APNs)"
- Apple will generate a 10-digit ID and an authentication token signing key. Store it safely.
To configure iOS mobile push notifications for your MagicBell project, follow these steps:
- From the Settings → Channels page in your dashboard, select Add Provider → Mobile Push → Safari APNs .
- Enable the provider and complete the required fields, then click Save.
MagicBell needs the P8 key ID, team ID for your Apple account, P8 cert, and the iOS app's bundle ID.
Provider Overrides
Our create notifications endpoint allows you to customize the payload sent to the APNs by setting notification.overrides
.
The notification.overrides.ios
parameter accepts all the body parameters of the APNs API.
Provider-specific parameters in notification.overrides
take precedence over the ones specified in notification
.
Example: Set the bagde of the app icon
{
"notification": {
"title": "We are processing your order",
"content": "Thank you for your order. We will notify you when these items are ready.
",
"recipients": [
{
"email": "[email protected]"
}
],
"overrides": {
"providers": {
"apns": {
"aps": {
"badge": 5
}
}
}
}
}
}