0

When I tap on the banner of a remote notification of my app as this is closed, the app is launched but remains fixed on the splash screen. Which does not happen when I open the app normally or when I click on remote notification when my app is open.

-(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");
}

How can i fix it?

pkamb
  • 33,281
  • 23
  • 160
  • 191
  • When you open the app by clicking the notification, `didFinishLaunchingWithOptions` is called. Is the code you supplied the entire code for that method? Perhaps you should add some log prints to see where it gets stuck. – Eran May 21 '13 at 15:49
  • App Open In Foreground -> call to didReceiveRemoteNotification App Open In Background -> badge or alert -> resume app App Closed -> badge or alert -> app launched but remaines fixed on splash screen ad doesn't show anything – Andrea Marzoli May 21 '13 at 15:50
  • How can I show log when app is closed? How can I debug it? – Andrea Marzoli May 21 '13 at 15:52
  • Check [this](http://stackoverflow.com/questions/1239000/debugging-app-when-launched-by-push-notification) out. – Eran May 21 '13 at 18:28

0 Answers0