美文网首页
iOS APNS推送如何区分设备,如何将设备的信息传给Apple

iOS APNS推送如何区分设备,如何将设备的信息传给Apple

作者: Snow_L | 来源:发表于2019-04-28 22:15 被阅读0次

    iOS APNS推送如何区分设备,如何将设备的信息传给Apple,你上传的时机是怎样的,猜想这个设备信息是如何上传的。

    1.区分设备

    通过registerForRemoteNotifications、didRegisterForRemoteNotificationsWithDeviceToken:获取deviceToken区分设备;

    2.设备信息传递给Apple

    Post请求;Use HTTP/2 and TLS 1.2 or later to establish a connection between your provider server and one of the following servers:

    (1.)Development servers:api.sandbox.push.apple.com:443

    (2.)Production sever:api.push.apple.com:443

    3.上传时机

    didRegisterForRemoteNotificationsWithDeviceToken方法

    4.设备信息

    This address takes the form of a device token unique to both the device and your app.

    5.猜测

    UDID + bundleID + 生产/开发环境 + 时间戳   其中注意带时间戳hash是为什么频繁上传device token 的主要原因。长期不活跃app,比如用户一个月或者两个月没打开过该app,该服务器后端就再也推不到了。

    欢迎大家指出文中的错误!

    也欢迎大家指出文中的不足!

    相关文章

      网友评论

          本文标题:iOS APNS推送如何区分设备,如何将设备的信息传给Apple

          本文链接:https://www.haomeiwen.com/subject/xersnqtx.html