找到设备令牌Xcode?对于推送通知

时间:2012-04-20 22:39:00

标签: ios xcode device token apple-push-notifications

我正在尝试查找设备令牌,以便我可以发送推送通知,但这不会向NSLog发送任何内容。

(void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
      NSLog(@"My token is: %@", deviceToken);
}

1 个答案:

答案 0 :(得分:0)

是否已使用以下命令启用通知?

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];