以下文章根据iOS原文理解所得:https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html
一、push传播前的一些认证
苹果APNS(Apple Push Notification Service)在push推送前进行Security Architecture,主要包含connection trust和token trust。
1、connection trust分为device-to-service和provider-to-service,两者连接方式类似,例如device-to-service为device发起TLS连接,APNS返回服务器证书,device认证后返回给APNS,APNS确认后建立TLS连接。
如图:
2、token trust:设备系统发起请求,APNS产生包含设备唯一信息的设备令牌,并加密后传给device,device把device token作为一个NSData对象传给app,app再传给provider
二、push内容
push主要包含device token 和payload,其中payload:pas[alert(title、body、title-lox-key、title-loc-args、action-lox-key、loc-key、launch-image)、badge、sound]
alert:An alert message to display to the user
badge:A number to badge the app icon with
sound:A sound to play
三、一条push(device token +payload)消息从生产到手机端收到的过程
ps:账户smile_511与Tester_Smile为同一人,因账户smile_511异常,新申请账号Tester_Smile