iOS – DidRegisterforremotenotificationswithdevicetoken: NULL token

I am receiving the callback didRegisterForRemoteNotificationsWithDeviceToken:, but the data returned to me is empty…. So I don’t know the device token.

Is there any Has anyone seen this or have any suggestions?

Thank you

The answer is, I can’t just use UTF8 encoding to make NSData The card reads into the NSString and expects it to display the token.

This does not work:

- (void)application:(UIApplication *) application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)_deviceToken

NSLog(@"=== Device token: %@", [[[NSString alloc] initWithData:_deviceToken encoding:NSUTF8StringEncoding] autorelease]);

Do this:

NSLog(@"data %@", _deviceToken);

I am I received the callback didRegisterForRemoteNotificationsWithDeviceToken:, but the data returned to me is empty…. So I don’t know the device token.

Has anyone seen this before or have any suggestions?

Thank you

The answer is that I can’t just use UTF8 encoding to read the NSData token into NSString and expect it to display the token. < p>

This does not work:

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)_deviceToken

NSLog(@"=== Device token: %@", [[[NSString alloc] initWithData:_deviceToken encoding:NSUTF8StringEncoding] autorelease]);

Do this:

< p>

NSLog(@"data %@", _deviceToken);

Leave a Comment

Your email address will not be published.