APNS(Apple Push Notification Service)远程推送原理解析
来源:互联网 发布:手机淘宝买家秀没有了 编辑:程序博客网 时间:2024/06/05 05:38
IOS app大多数都是基于client/server模式开发的,client就是安装在我们设备上的app,server就是远程服务器,主要给我们的app提供数据,因此也被称为Provider.那么问题来了,当app处于杀死状态下,当client与server断开的时候,client如何与server进行通信呢?是的,这时候Remote Notification很好的解决了这个窘境,当客户端与服务端断开连接时,苹果通过APNS与client建立长链接。苹果所提供的一套服务称之为Apple Push Notification server就是我们所谓的APNS。
推送消息传输路径:
我们的设备联网时,都会与苹果的apns服务器建立一个长连接,当Provider推送一条通知的时候,这条通知并不是直接送给了我们的设备,而是先推送到苹果的pans服务器上面,而苹果的apns服务器再通过与设备建立的长连接进而把通知推送到我们的设备上,而当非联网状态的时候,apns服务器会保留推送的最后一条通知,当设备处于联网状态,apns服务器会将其保留的最后一条通知推送到我们的设备上,如果设备长时间处于非联网状态下,那么apns服务器为其保存的最后一条通知也会丢失。Remote notification必须要求设备联网状态下才能收到,并且太频繁的接受远程通知
DeviceToken 的详细说明
当一个app注册接收远程通知时,系统会发送请求到apns服务器,apns服务器收到此请求会根据请求所带的key值生成独一无二的value值,也就是所谓的deviceToken,而后apns会将deviceToken打包成NSData发给对应请求的app,然后app把此deviceToken发送给我们自己的服务器,就是所谓的Provider,给我们的设备推送通知的时候,必须包含此deviceToken
- APNS(Apple Push Notification Service)远程推送原理解析
- APNS - Apple Push Notification Service
- Apple Push Notification Service (APNS)原理与实现方案
- Apple Push Notification Service (APNS)原理与实现方案
- iOS - APNs(Apple Push Notification Services)推送通知
- APNs Apple Push Notification Services 推送消息
- iPhone Apple Push Notification Service (APNS)(全教程)
- iPhone Apple Push Notification Service (APNS)(全教程)
- iPhone Apple Push Notification Service (APNS)(全教程)
- iPhone Apple Push Notification Service (APNS)
- Apple Push Notification Service(APNS)开发指引
- Apple Push Notification Service(APNS)开发指引
- Apple Push Notification Service(APNS)相关
- iphone 推送服务--Apple Push Notification Service
- iphone 推送服务--Apple Push Notification Service
- iphone 推送服务--Apple Push Notification Service
- iphone 推送服务--Apple Push Notification Service
- iphone 推送服务--Apple Push Notification Service
- 执行过程
- Python Unicode码无法转为中文字符问题
- python mutilprocess
- QNX的license-key,试用qnx入门参考-QNX的密钥账号密码
- [杂题 贪心] Codeforces 808E. Selling Souvenirs
- APNS(Apple Push Notification Service)远程推送原理解析
- CodeForces 868 E. Policeman and a Tree
- request中文乱码/请求转发mvc/地址写法/防盗链
- 前端学科笔记分享——vue.js
- 高质量 Android 开发框架 LoonAndroid 详解
- 文件属性查看、所有人所有组管理,普通权限,特殊权限,访问控制,默认权限
- SCA 2017移动安全技术商业模式论坛——移动终端与物联网应用安全
- Caffe_Windows学习笔记(六)图形化操作工具digits的安装与运行
- leetcode Merge Two Sorted Lists