I need to pass through server auth method, which needs deviceToken for registration. But I have only simulators, and can't take tokens from them, and I want to send to server false token (like 000 000 000) But I don't know how many digits are there in device token. Can anyone help me out with a sample device token?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Device token is of 32 Bytes. Sample device token is provided for your reference from raywenderlich
740f4707 bebcf74f 9b7c25d4 8e335894 5f6aa01d a5ddb387 462c7eaf 61bb78ad
回答2:
Apple Local and Remote Notification Programming Guide clearly states:
"Important: APNs device tokens are of variable length. Do not hardcode their size."
The may currently have 32 bytes but hardcoding that will make your app break in the future!
回答3:
It is 32 bytes. Written in hexadecimal they will take 64 digits.
You can check this page for more detail :
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html