Meet Push Notifications Console

Written by Marco Eidinger

Description: The Push Notifications Console is the best way to quickly test user notifications in your app. Learn how you can iterate on new ideas quickly by sending notifications directly from the console and analyze delivery logs to learn more about your pushes. We'll also show you how to generate and validate tokens to successfully authenticate with Apple Push Notification service (APNs). To get the most out of this session, you should have a basic understanding of Apple Push Notification service (APNs) and user notifications.

The Push Notifications Console, a web-based tool with a variety of instruments for interacting with Apple Push Notification service (APNs), allows you to

  • send notifications from the console to your device through APNS.
  • inspect delivery logs to analyze why a message was not received.
  • validate and/or generate JWT when using token-based authentication
  • validate device tokens

Access to the tool: https://icloud.developer.apple.com/dashboard/notifications

Send Notifications

The Console allows you to test many types of notifications and different attributes. You can

  • specify the environment
  • try different push types
  • set the exact expiration
  • try different priorities
  • and send any type of payload.
Send Notification

Delivery Log

Analyze why a notification was not received

As a notification travels through the APNs stack the events that reflect its delivery process are recorded. And now you can retrieve that information, using the header apns-unique-id that APNs returns when the notification is sent.

apns-unique-id

For example, you can identify a push notification was not yet delivered because the device has enabled Low Power mode.

Or notification can go to APNs storage if the device is offline or can be discarded if the app was removed from the device.

Delivery Log

Generate JWT

Token-based authentication uses JSON Web Tokens for secure and efficient authentication between your provider server and APNs. It requires generating a token signed with a private key associated with your Apple Developer account. Private keys don't expire like certificates. As part of Push Notifications Console, there's now a tool that can generate an authentication token for you.

Generate JWT

You can then use it to authenticate your requests against APNs. Keep in mind that the validity period of these tokens can not exceed one hour, so they need to be rotated periodically.

Validate JWT

If you already have a token, but think it might not be working, you can validate the token.

Validate JWT

In the example above the validation result is telling me that the “issued at” claim is too old, which effectively means that the token has expired.

Validate Device Token

Device tokens are used to specify the recipient when you send a notification. They are tied to a concrete environment and push type.

When you enter a token, you will get a response that will tell you which environment and push type the token is valid for, if any.

Validate Device Token

Missing anything? Corrections? Contributions are welcome 😃

Related

Written by

Marco Eidinger

Marco Eidinger

Software engineer working on open source and enterprise mobile SDKs for iOS and macOS developers written in Swift