Amazon SNS ios device token length
amazon-sns, apple-push-notifications, ios
Solution
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
Problem
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?