我正在尝试查找设备令牌,以便我可以发送推送通知,但这不会向NSLog发送任何内容。
(void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
NSLog(@"My token is: %@", deviceToken);
}
答案 0 :(得分:0)
是否已使用以下命令启用通知?
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];