Files
knowledge-kit/Chapter1 - iOS/1.33.md
2020-02-25 17:46:51 +08:00

28 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 推送
> 1、现在 App 开发推送功能,一般都是接入极光推送,那么为什么极光推送就可以实现推送呢?
2、极光推送做了哪些事情与 APNS 怎么交互的?
带着这2个问题来看看推送吧
## 一、推送原理
![推送原理](/assets/4316713-49ef454cca917acd.jpg)
(这张图转载于网络)
说说推送的步骤:
1、你的 App 需要推送服务,要向苹果的 APNS 注册推送功能
2、当苹果 APNS 推送服务器收到你的注册请求后会返回给你一串 device token
3、当应用收到 device token 后,需要将 device token 传给自己的应用服务器(自己公司的服务端)
4、当你需要为你的应用推送消息的时候自己的应用服务器会将消息以及 device token 打包发送给苹果的 APNS。
5、APNS 再将消息推送给你的 手机 App
## 不接入极光推送的话,自己怎么做推送功能
参考这篇文章:[自己做推送](https://blog.csdn.net/shenjie12345678/article/details/41120637)
## 所以极光推送逗帮我们做了什么?
简化了获取 device token 的步骤,我们将申请号的证书上传到极光服务器,程序运行接入极光 SDK ,手机获取 device token, 然后将 device token 上传给极光推送服务器,。