Register成功,但调用了两次DeviceToken的RegisterForRemomentNotifications
每次启动我的应用程序,都会调用两次使用DeviceToken的Register成功,但调用了两次DeviceToken的RegisterForRemomentNotifications,notifications,push,Notifications,Push,每次启动我的应用程序,都会调用两次使用DeviceToken的DidRegisterForRemotionTifications,推送可以正常发送和接收 code: // launch method - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if (iOS8_OR_LATER) { // register rem
DidRegisterForRemotionTifications,推送可以正常发送和接收
code:
// launch method
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
if (iOS8_OR_LATER)
{
// register remote notification
[[UIApplication sharedApplication] registerForRemoteNotifications];
[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert categories:nil]];
}
else
{
// register remote notification
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert];
}
}