如何从我的iPhone设备获取设备 token ?
最佳答案
如果要查看设备 token ,也可以在UIAlert中看到,此方法将在 Debug模式下在控制台中打印deviceToken。
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSLog(@"APN device token: %@", deviceToken);
NSString *deviceTokenString = [NSString stringWithFormat:@"%@",deviceToken];
UIAlertView *deviceTokenAlert = [[UIAlertView alloc] initWithTitle:@"Device Token"
message:deviceTokenString
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
}
关于iphone - 推送通知设备 token ?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1340316/