apns push notification not sent : Baddevicetoken

2.3k Views Asked by At

I have a problem with apns sharp:

I get the device token from my iTunes for the iPhone, and I put it into the program.

However I am getting a baddevicetokenexception : 40 , invalid ... error. He must have 64 characters.

I don't know how to get a device token with 64 characters?

Thanks.

1

There are 1 best solutions below

0
On

Your id is the unique identifier of the iPhone, but the devicetoken is the id to send to Apple for notifications.

To get the deviceToken :

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {