Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Azure Notification Hub to use APNS token authentication mode?

I am trying to add APNS connection in Azure Notification Hub with Token as authentication mode.

I have searched around but I am not able to find any guides anywhere to make this work.

Maybe someone has a link to a guide showing how to find the information needed?

I tried to create a "APNs Auth Key" in Apple developer console, but that gives me a .p8 file and the token inside that file does not seem to be accepted, so I guess I need to find the token somewhere else.

I hope someone have a link to a guide for setting this up and find the information needed.

enter image description here

like image 241
Lars Nymand Avatar asked May 09 '17 12:05

Lars Nymand


People also ask

What is APNs token?

Apple Push Notification service (APNs) must know the address of a user's device before it can send notifications to that device. This address takes the form of a device token unique to both the device and your app.

How do I send Azure push notifications?

In the Azure portal, on the Notification Hub page, select Windows Phone (MPNS) from the left menu. Enable either unauthenticated or authenticated push notifications: a. To enable unauthenticated push notifications, select Enable unauthenticated push > Save.

What is Azure push notification?

Azure Notification Hubs is a massively scalable mobile push notification engine for quickly sending millions of notifications to iOS, Android, Windows, or Kindle devices, working with APNs (Apple Push Notification service), GCM (Google Cloud Messaging), WNS (Windows Push Notification Service), and more.


1 Answers

Update (Apr 2018): @Krumelur reports in the comments that the blog article is out of date. Check out his suggestion on how to fix it to avoid getting errors.


Update (June 2017): There is now an official Microsoft post about Token-based (HTTP/2) Authentication for APNS.


Original answer (May 2017):

Token Based Authentication and HTTP/2 Example with APNS is a good step by step guide of how to get those values from your Apple Developer Account.

  • Key ID in Azure Portal is what APNS_KEY_ID is in the sample above
  • App Name in Azure Portal is your app name
  • App ID in Azure Portal is what TEAM_ID is in the sample above
  • Token in Azure Portal is the contents of the file referred to in APNS_AUTH_KEY variable in the sample above

Do not forget to keep track which keys and tokens are sandbox and which are production endpoint ones.

like image 106
Nikita R. Avatar answered Sep 22 '22 17:09

Nikita R.