what’s new in apple push notification service › videos › wwdc › 2016 › 724x... ·...

47
© 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. System Frameworks #WWDC16 Session 724 What’s New in Apple Push Notification Service Mayur Mahajan Apple Push Notification Service Engineer

Upload: others

Post on 07-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

© 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

System Frameworks #WWDC16

Session 724

What’s New in Apple Push Notification Service

Mayur Mahajan Apple Push Notification Service Engineer

Page 2: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Review

HTTP/2 provider APIInstant feedbackLarger payloadSimplified certificate handling

Page 3: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Sending notificationsHTTP/2 Provider API

APNs Provider

Client App

Page 4: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Sending notificationsHTTP/2 Provider API

APNs Provider

Client App

Page 5: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Sending notificationsHTTP/2 Provider API

APNs Provider

Client App

Page 6: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Sending notificationsHTTP/2 Provider API

APNs Provider

Client App

Page 7: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Sending notificationsHTTP/2 Provider API

APNs Provider

Client App

Page 8: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Sending notificationsHTTP/2 Provider API

APNs Provider

Client App

HTTP/2 request

Page 9: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Sending notificationsHTTP/2 Provider API

APNs Provider

Client App

HTTP/2 request

HTTP/2 request

Page 10: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Simplified Certificate Handling

Application pushVoIP pushComplication pushDevelopment and production environment

Page 11: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Token Authentication

NEW

Page 12: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Token Authentication

Page 13: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Token Authentication

Simplified provider authentication when connecting to APNsSecureEasy to generateNo more expired certificates!

Page 14: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Connecting to APNs with client certificateCertificate Authentication

AccountAPNs Provider

Page 15: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Connecting to APNs with client certificateCertificate Authentication

AccountAPNs Provider

Page 16: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Connecting to APNs with client certificateCertificate Authentication

Account

TLS

APNs Provider

Page 17: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Connecting to APNs with client certificateCertificate Authentication

Account

TLS

APNs Provider

Page 18: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Connecting to APNS with Token AuthenticationToken Authentication

AccountAPNs Provider

Page 19: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Connecting to APNS with Token AuthenticationToken Authentication

AccountAPNs Provider

Page 20: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Connecting to APNS with Token AuthenticationToken Authentication

Account

TLS

APNs Provider

Page 21: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Connecting to APNS with Token AuthenticationToken Authentication

Account

TLS

APNs Provider

Page 22: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Connecting to APNS with Token AuthenticationToken Authentication

Account

TLS

APNs Provider

Page 23: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Token Authentication

TLS

APNs Provider

Page 24: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Token Authentication

TLS

APNs Provider

Request with token

Page 25: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Token Authentication

TLS

APNs Provider

Page 26: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Token Authentication

TLS

APNs Provider

Response

Page 27: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

DetailsToken Authentication

Provision signing key via Developer Account

Page 28: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

DetailsToken Authentication

Provision signing key via Developer Account

Page 29: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

DetailsToken Authentication

Provision signing key via Developer AccountConstruct the token Sign token using ES256 (ECDSA using P256 curve, SHA256 hash)

Page 30: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// JSON Web Tokens

eyJhbGciOiJFUzI1NiIsImtpZCI6IkFCQ0RFRkdISUoifQ.eyJpc3MiOiIxMjM0NTY3ODkwIiwiaWF0Ijoi

MTQ2Mzk3NTIzMyJ9.aBup1REyXE9Po8ekWJ3ifUly67NlPyTlcgfSwy...

Header

{

"alg": "ES256",

"kid": "ABCDEFGHIJ"

}

Claims

{

"iss": “QRSTUVWXYZ”,

"iat": "1463975233"

}

Signature

Page 31: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// JSON Web Tokens

eyJhbGciOiJFUzI1NiIsImtpZCI6IkFCQ0RFRkdISUoifQ.eyJpc3MiOiIxMjM0NTY3ODkwIiwiaWF0Ijoi

MTQ2Mzk3NTIzMyJ9.aBup1REyXE9Po8ekWJ3ifUly67NlPyTlcgfSwy...

Header

{

"alg": "ES256",

"kid": "ABCDEFGHIJ"

}

Claims

{

"iss": “QRSTUVWXYZ”,

"iat": "1463975233"

}

Signature

Page 32: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// JSON Web Tokens

eyJhbGciOiJFUzI1NiIsImtpZCI6IkFCQ0RFRkdISUoifQ.eyJpc3MiOiIxMjM0NTY3ODkwIiwiaWF0Ijoi

MTQ2Mzk3NTIzMyJ9.aBup1REyXE9Po8ekWJ3ifUly67NlPyTlcgfSwy...

Header

{

"alg": "ES256",

"kid": "ABCDEFGHIJ"

}

Claims

{

"iss": “QRSTUVWXYZ”,

"iat": "1463975233"

}

Signature

Page 33: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// JSON Web Tokens

eyJhbGciOiJFUzI1NiIsImtpZCI6IkFCQ0RFRkdISUoifQ.eyJpc3MiOiIxMjM0NTY3ODkwIiwiaWF0Ijoi

MTQ2Mzk3NTIzMyJ9.aBup1REyXE9Po8ekWJ3ifUly67NlPyTlcgfSwy...

Header

{

"alg": "ES256",

"kid": "ABCDEFGHIJ"

}

Claims

{

"iss": “QRSTUVWXYZ”,

"iat": "1463975233"

}

Signature

Page 34: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// JSON Web Tokens

eyJhbGciOiJFUzI1NiIsImtpZCI6IkFCQ0RFRkdISUoifQ.eyJpc3MiOiIxMjM0NTY3ODkwIiwiaWF0Ijoi

MTQ2Mzk3NTIzMyJ9.aBup1REyXE9Po8ekWJ3ifUly67NlPyTlcgfSwy...

Header

{

"alg": "ES256",

"kid": "ABCDEFGHIJ"

}

Claims

{

"iss": “QRSTUVWXYZ”,

"iat": "1463975233"

}

Signature

Page 35: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// JSON Web Tokens

eyJhbGciOiJFUzI1NiIsImtpZCI6IkFCQ0RFRkdISUoifQ.eyJpc3MiOiIxMjM0NTY3ODkwIiwiaWF0Ijoi

MTQ2Mzk3NTIzMyJ9.aBup1REyXE9Po8ekWJ3ifUly67NlPyTlcgfSwy...

Header

{

"alg": "ES256",

"kid": "ABCDEFGHIJ"

}

Claims

{

"iss": “QRSTUVWXYZ”,

"iat": "1463975233"

}

Signature

Page 36: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// JSON Web Tokens

eyJhbGciOiJFUzI1NiIsImtpZCI6IkFCQ0RFRkdISUoifQ.eyJpc3MiOiIxMjM0NTY3ODkwIiwiaWF0Ijoi

MTQ2Mzk3NTIzMyJ9.aBup1REyXE9Po8ekWJ3ifUly67NlPyTlcgfSwy...

Header

{

"alg": "ES256",

"kid": "ABCDEFGHIJ"

}

Claims

{

"iss": “QRSTUVWXYZ”,

"iat": "1463975233"

}

Signature

Page 37: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// Request example

HEADERS

- END_STREAM

+ END_HEADERS

:authority = api.push.apple.com

:method = POST

:path = /3/device/ad2bcd38f6773cdad050411...

authorization = bearer eyJhbGciOiJFUzI1N...

apns-topic = com.foo.tokenauth

DATA

+ END_STREAM

{ "aps" : { "alert" : "Hello Token Authentication" } }

Page 38: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// Request example

HEADERS

- END_STREAM

+ END_HEADERS

:authority = api.push.apple.com

:method = POST

:path = /3/device/ad2bcd38f6773cdad050411...

authorization = bearer eyJhbGciOiJFUzI1N...

apns-topic = com.foo.tokenauth

DATA

+ END_STREAM

{ "aps" : { "alert" : "Hello Token Authentication" } }

Page 39: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// Response example

HEADERS

+ END_STREAM

+ END_HEADERS

:status = 200

Page 40: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// Response example

HEADERS

- END_STREAM

+ END_HEADERS

:status = 403

content-type = application/json

DATA

+ END_STREAM

{ "reason": "InvalidProviderToken" }

Page 41: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

// Token Authentication

// Response example

HEADERS

- END_STREAM

+ END_HEADERS

:status = 403

content-type = application/json

DATA

+ END_STREAM

{ "reason": "ExpiredProviderToken" }

Page 42: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

DetailsToken Authentication

Signed tokens need to be generated periodicallySigning key does not expireSigning key can be revoked through your Account

Page 43: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Coming later this year…

Page 44: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

More Information

https://developer.apple.com/wwdc16/724

Page 45: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Related Sessions

Introduction to Notifications Pacific Heights Wednesday 9:00AM

Advanced Notifications Pacific Heights Wednesday 10:00AM

Page 46: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified

Labs

Notifications Lab Frameworks Lab C Wednesday 11:00AM

Notifications Lab Graphics, Games & Media Lab B Friday 9:00AM

Page 47: What’s New in Apple Push Notification Service › videos › wwdc › 2016 › 724x... · 2016-07-09 · Review HTTP/2 provider API Instant feedback Larger payload Simplified