iOS Dev Nugget 253 Token-based Push Provider Connections


Need to run a code review on your codebase? Hire me

The HTTPS/2-based push provider API introduced in 2015 has a very nice addition — instead of using certificates for push provider authentication, you can also use JSON Web Tokens (JWT).

To use token-based authentication, you need to generate a key [1] in Apple developer member center. Keys/tokens has two benefits over certificates:

  • Keys are tied to a developer account, not to a specific app. A token-based connection to the HTTPS/2 API can be used to send push notifications to all your apps.
  • Keys don't expire. But you are required to regenerate tokens within the hour.

If you manage your own push provider infrastructure, using tokens can be very helpful.

Refer to Apple doc on Communicating with APNs for details.

[1] It can be slightly confusing. "Key" is actually a certificate too.

Your feedback is valuable: Do you want more nuggets like this?   Yes   or   No



Like this and want such iOS dev nuggets to be emailed to you, weekly?

Sign Me Up! or follow @iosdevnuggets on Twitter


View archives of past issues