Size of iPhone device token

后端 未结 4 740
一生所求
一生所求 2020-12-18 19:12

What is the size of the device token generated by APNs (Apple Push Notification). I am trying to store device tokens on the server side in a mysql database, and would like t

相关标签:
4条回答
  • 2020-12-18 19:46

    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

    0 讨论(0)
  • 2020-12-18 19:58

    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

    0 讨论(0)
  • 2020-12-18 20:10

    Apple Push Notification Service Programming guide very clearly says:

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

    0 讨论(0)
  • 2020-12-18 20:10

    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.

    0 讨论(0)
提交回复
热议问题