29
Comment puis-je convertir mon jeton d'appareil (NSData) en NSString?
J'implémente des notifications push. Je souhaite enregistrer mon jeton APNS en tant que chaîne. - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken { NSString *tokenString = [NSString stringWithUTF8String:[newDeviceToken bytes]]; //[[NSString alloc]initWithData:newDeviceToken encoding:NSUTF8StringEncoding]; NSLog(@"%@", tokenString); NSLog(@"%@", newDeviceToken); } La première ligne de code imprime null. le second imprime le jeton. Comment puis-je obtenir mon …