Size of iPhone device token

冷暖自知 提交于 2019-11-29 09:20:55
Philip Whitehouse

You get told but it's currently 32 bytes. Apple says the token length is variable and to not hard code it

When you get a notification it has a header, currently 35 bytes in size. This is arranged as follows:

  • Byte 1: Command
  • Byte 2-3: Token length
  • Bytes 4-35: Token

Source: http://mark.aufflick.com/files/view/talks/apns.pdf

Samo

Apple Push Notification Service Programming guide very clearly says:

"Important: APNs device tokens are of variable length. Do not hardcode their size."

Cameron Bielstein

According to Apple's iOS Developer Library, it's 32 bytes, as Philip said.

Here's a link to their page on "Local and Push Notification Programming," which may include other helpful information on the subject.

https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/Introduction.html

The limit in iOS8 is reported to be 2k. Still half of the size of GCM's 4k, but I suspect most people will have to alter their tables to handle the new iOS8 token limit.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!