0

当我在我的应用程序关闭时点击远程通知的横幅时,应用程序会启动但仍固定在启动屏幕上。当我正常打开应用程序或在我的应用程序打开时单击远程通知时不会发生这种情况。

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

  self.window.rootViewController = self.tabBarController;
  [self.window makeKeyAndVisible];

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

  return YES;
}

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

-(void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
   NSLog(@"Failed to get token, error: %@", error);
}

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
   NSLog(@"receive");
}

我该如何解决?

4

0 回答 0