Missing or incorrect device token

I followed the tutorial: Push Notifications Tutorial: Getting Started
but I misplaced the device token that appeared on the console.
How can i get it back?
When I visit the Apple Developer website I can find an identifier under iPhone(Devices). This identifier is called there UDID and it looks like a device token but is it?

Is that where I can retrieve my device token when I misplace it?


First of all, Device token and Device UDID are different things.

  1. Device UDID is device identifier, and that is unique per device and never changed during devices’ life.
  2. Device token is changed every time when app deleted from mobile and installed again.

When you have installed fresh application at that time it will ask to user like below :

And if user press “OK” then you will get your device token in following method :

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

    NSString *token = [[deviceToken description] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@"<>"]];
    token = [token stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSLog(@"deviceToken --> %@", token);

And you can use it wherever you want.