iOS APNS推送如何區(qū)分設(shè)備,如何將設(shè)備的信息傳給Apple,你上傳的時(shí)機(jī)是怎樣的,猜想這個(gè)設(shè)備信息是如何上傳的。
1.區(qū)分設(shè)備
通過(guò)registerForRemoteNotifications、didRegisterForRemoteNotificationsWithDeviceToken:獲取deviceToken區(qū)分設(shè)備;
2.設(shè)備信息傳遞給Apple
Post請(qǐng)求;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.上傳時(shí)機(jī)
didRegisterForRemoteNotificationsWithDeviceToken方法
4.設(shè)備信息
This address takes the form of a device token unique to both the device and your app.
5.猜測(cè)
UDID + bundleID + 生產(chǎn)/開(kāi)發(fā)環(huán)境 + 時(shí)間戳? ?其中注意帶時(shí)間戳hash是為什么頻繁上傳device token 的主要原因。長(zhǎng)期不活躍app,比如用戶(hù)一個(gè)月或者兩個(gè)月沒(méi)打開(kāi)過(guò)該app,該服務(wù)器后端就再也推不到了。