I'm seeing a peculiar behavior with my push notification and was wondering if anyone has any advise on what I did wrong or should do.

I have my application:(UIApplication*)application didReceiveRemoteNotification: written as follows:

- (void)application:(UIApplication*)application didReceiveRemoteNotification: (NSDictionary*)userInfo
{
NSLog(@"Received notification: %@", userInfo);
[self addMessageFromRemoteNotification:userInfo updateUI:YES];
} 

As you can see, I'm not worried about the state of the app. I just want to log a message whenever I get a PN.

My setup is as per the documentation from Apple and I can receive push notifications.

The following are the expected behaviours when a PN comes in:

  • App is in the background and I click on the notification: I can see the notification in notification center. Click on the notification, the app comes to the foreground and I can see the above method is called.
  • App is active and already in the foreground: I can see the above method is called.

Now, the following is the peculiar behaviour I am seeing:

  • PN comes in. See it in the notifications, see the badge on the app icon. I click on the app icon - not the notification: In this instance I found that the above method is not called. I was expecting it to be called...

Has anyone seen this behaviour before? Is this what should happen? I couldn't see anything in the Apple documentation regarding this... Also, would there be a way around this?

Edit
Report