Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Size of iPhone device token

Tags:

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

like image 360
user462455 Avatar asked Sep 17 '12 02:09

user462455


People also ask

What is a device token for iPhone?

A device token is an identifier for the Apple Push Notification System for iOS devices. Apple assigns a Device Token on a per-app basis (iOS 7 and later) which is used as a unique identifier for sending push notifications.

Where do I find my iPhone device token?

Install either Xcode or iPhone Configuration UtilityHighlight your device name on the left, and go to the Console tab. Copy the above, remove spaces if present. This is your device token.

Is device token unique in iOS?

The Device Tokens are NOT unique to the phone-app pairing. They are unique to the phone only. If you have multiple apps with push on the same phone they will all use the same Device Token. The certificate you use to send the notification will dictate which app it goes to.

What is device token in Apple Push Notification?

'The device token you provide to the server is analogous to a phone number; it contains information that enables APNs to locate the device on which your client app is installed. APNs also uses it to authenticate the routing of a notification. '


Video Answer


1 Answers

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

like image 86
Philip Whitehouse Avatar answered Nov 10 '22 07:11

Philip Whitehouse