I am implementing push notifications. I\'d like to save my APNS Token as a String.
- (void)application:(UIApplication *)application didRegisterForRemoteNotif
This is a little bit shorter solution:
NSData *token = // ... const uint64_t *tokenBytes = token.bytes; NSString *hex = [NSString stringWithFormat:@"%016llx%016llx%016llx%016llx", ntohll(tokenBytes[0]), ntohll(tokenBytes[1]), ntohll(tokenBytes[2]), ntohll(tokenBytes[3])];