Paul T.
Paul T.

Reputation: 5038

Apple push notification integration issue

Before I always had to give push notifications certificates (p12 files) to the server developer, so he could send push notifications to my applications.

But as far as I understand now it's possible to do without these certificates according to https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH101-SW1

According to Apple:

A provider authentication token is a JSON object that you construct, whose header must include: The encryption algorithm (alg) you use to encrypt the token A 10-character key identifier (kid) key, obtained from your developer account The claims payload of the token must include: The issuer (iss) registered claim key, whose value is your 10-character Team ID, obtained from your developer account The issued at (iat) registered claim key, whose value indicates the time at which the token was generated, in terms of the number of seconds since Epoch, in UTC

The question is where to take these kid, iss, iat values from the developer account?

Upvotes: 3

Views: 631

Answers (1)

Paul T.
Paul T.

Reputation: 5038

Actually I've watched the video from WWDC https://www.youtube.com/watch?v=IDBCTvHrix8, it explained almost everything.

1) for kid you need to https://developer.apple.com -> Certificates, Identifiers & Profiles -> APNs Auth Key -> Press + button -> choose Apple Push Notification Authentication Key (Sandbox & Production) (it was added not so long ago) -> After you create it, you will see Key ID in this item (new item will appear in APNs Auth Key menu). This is your kid value

2) iss is your team ID, to take it you need to Certificates, Identifiers & Profiles -> Identifiers -> App IDs -> Press on any of your App IDs (if you don't have any, you need to create one for your application) -> you will see the details where you will see Prefix: 8jkjlj2k . This is your team ID and it will be the same for all your apps in your developer account.

3) iat : As far as I understand it's the time when server developer generated the token on his side, so you don't need to provide this value to the server developer

Upvotes: 6

Related Questions