Why the received deviceToken
in application:didRegisterForRemoteNotificationsWithDeviceToken
is a NSData?
Aren't we always converting it to NSString
/String
and send it to our backend? Is there any other use case that made Apple to use NSData
type(instead of NSString
/String
) for it?
Thanks.
Looking at the documentation, it reads
The APNs servers require a binary format for performance reasons.
So I assume their intention was to avoid the two conversions in the cycles: NSData to NSString, send to server, server convert to binary format, send to APNs.
Or since they're expecting it in binary format, they might as well give it to you in binary format.