6

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

Nikita R.
  • 7,245
  • 3
  • 51
  • 62
Lars Nymand
  • 61
  • 1
  • 3

3 Answers3

5

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.

Nikita R.
  • 7,245
  • 3
  • 51
  • 62
  • 1
    Thank you for your answer! I think it is important to note that `App Name` is not just a name. It is you fully qualified name like "com.company.app" – Lars Nymand Jun 09 '17 at 08:42
  • is token path to p8 file? – sof98789 Jun 13 '17 at 13:35
  • 1
    @sof98789, in this case, it's the contents of the file. Open it in any editor and paste the value into the `Token` box. – Nikita R. Jun 13 '17 at 16:28
  • 5
    The documentation is no longer correct as the UI in the Azure portal has changed. It's now labeled "Key ID", "Bundle ID", "Team ID" and "Token". When entering the required info, the portal returns with an error about not base-64 formatted content. If you remove the "---BEGIN PRIVATE KEY--" and "---END PRIVATE KEY---" part it seems to work. – Krumelur Apr 18 '18 at 15:02
0

Looks like this is out of date. It is now looking for

Key ID Bundle ID Team ID Token

0

Everything is described now in the documentation here.

Jan Nepraš
  • 794
  • 1
  • 7
  • 29