I have an iPhone app I'm working on and trying to get Amazon SNS set up to test PNS. When we register the app with APNS, it gives a 32-digit device token (873DBDDA-17CF-4A24-88C6-990B90AFC4C3). When registering a device with Amazon SNS, it says the device token must be 64-digits long. What am I missing here?
A device token is not a device IMEI but an ID to identify a certain mobile app on a certain device. It is issued by calling libraries of FCM, JPush, or APNs. For JPush, an equivalent of a device ID is a registration ID in the aspect of its usage in the Kii Cloud environment.
Push token (device token) - is a unique key for the app-device combination which is issued by the Apple or Google push notification gateways. It allows gateways and push notification providers to route messages and ensure the notification is delivered only to the unique app-device combination for which it is intended.
Sending a test Android push notificationClick on Settings and open Mobile Apps. Click on the Android App and make sure the Firebase API key has been configured. Click on Test Push and enter the device token for your test device. Add a test payload and send the test.
The notification message sent by Amazon SNS for deliveries over HTTP, HTTPS, Email-JSON and SQS transport protocols will consist of a simple JSON object, which will include the following information: MessageId: A Universally Unique Identifier, unique for each notification published.
How did you get that token? It doesn't look like a correct APNS device token. A real one will be 64 hex digits. Here's the code I use:
-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSString *tokenstring = [[[deviceToken description]
stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]]
stringByReplacingOccurrencesOfString:@" " withString:@""];
// pass tokenstring to your APNS server
}
The token that I get out of that method looks like this:
8ec3bba7de23cda5e8a2726c081be79204faede67529e617b625c984d61cf5c1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With