Problem
When the app is running and a push message is sent, the callback is called and the message is displayed.
But when the app has been closed and a push message was sent, iOS displays an alert with the message, and then when the app is opened by clicking 'View' from the alert, the callback is called which displays a second alert with the same message.
According to a development comment, that method shouldn't be called if the app is started by a Notification.
Core source code
#pragma mark Push Notification Delegates
#ifdef USE_TI_NETWORKREGISTERFORPUSHNOTIFICATIONS
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
// NOTE: this is called when the app is *running* after receiving a push notification
// otherwise, if the app is started from a push notification, this method will not be
// called
RELEASE_TO_NIL(remoteNotification);
[self generateNotification:userInfo];
if (remoteNotificationDelegate!=nil)
{
[remoteNotificationDelegate performSelector:@selector(application:didReceiveRemoteNotification:) withObject:application withObject:remoteNotification];
}
}
Associated HD ticket
As an ENT customer relies on this, I set Customer priority to Immediate.
http://appc.me/c/APP-919486
Additional info
The message is being sent to the device using Urban Airship. Let me know please if anymore data is needed.
Will need a sample app/source that shows what the app does with the payload once they receive it. I have a sneaking suspicion that the JS code presents a dialog from notification. If this is the case, then the bug is invalid: If an application is running when the notification comes in, it should NOT present a dialog -- the user is already in the application -- but should update the information in the background with the payload. Similarly, when launched from an alert, the payload can be used to direct the application onto where to focus. For example, in an SMS app, if you receive an SMS, you do NOT get a dialog alerting you. Instead, the list of conversations is updated. When not in an SMS app and a notification happens, the OS provides an alert as an offering to view the SMS in detail. If the user so takes the offer, the payload is passed onto the app in order for the app to update the focus.
Closing ticket as the information that was requested was never provided.