天天看點

APNS Push 資料整理 & JAVA lib

準備證書,這篇文章說的是 p12 格式的證書

https://medium.com/@dmccoy/how-to-get-an-apple-push-notification-service-certificate-as-a-p12-e124c64093c0

官方協定流程

https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW1

靠譜的java版apns push開源庫,支援p12和新的token based p8

https://github.com/relayrides/pushy

c sharp版實作過程

https://tpu.thinkpower.com.tw/tpu/File/html/201611/20161122001842_f.html?f=3dj6j8kd38895ksgtdddd93865jhr9sn3rqkh

JWT相關介紹

https://jwt.io/

https://github.com/auth0/java-jwt

https://stormpath.com/blog/jwt-java-create-verify

https://stormpath.com/blog/beginners-guide-jwts-in-java

openssl指令

Convert .cer into .pem

openssl x509 -inform der -in certificate.cer -out certificate.pem

Convert key and certificate to P12

openssl pkcs12 -export -out apns_prod.p12 -inkey key_dist.pem -in cert_dist.pem