Reputation: 13608
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 to know maximum size of device tokens generated
Upvotes: 21
Views: 36701
Reputation: 2181
Apple Push Notification Service Programming guide very clearly says:
"Important: APNs device tokens are of variable length. Do not hardcode their size."
Upvotes: 19
Reputation: 4157
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:
Source: http://mark.aufflick.com/files/view/talks/apns.pdf
Upvotes: 21
Reputation: 429
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.
Upvotes: 4
Reputation: 7
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.
Upvotes: -7