{ "id": "78529", "key": "TIMOB-4838", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11363", "description": "Mobile 1.8.0 M10", "name": "Sprint 2011-31", "archived": true, "released": true, "releaseDate": "2011-08-08" } ], "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2011-08-01T12:28:59.000+0000", "created": "2011-07-29T13:44:36.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "callback", "ios", "look1", "notifications", "push" ], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-16T20:44:07.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4.Problem\r\nWhen the app is running and a push message is sent, the callback is called and the message is displayed.\r\n\r\nBut 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.\r\n\r\nAccording to a development comment, that method shouldn't be called if the app is started by a Notification.\r\n\r\nh4.Core source code\r\n{code:title=Tiapp.mm}\r\n#pragma mark Push Notification Delegates\r\n\r\n#ifdef USE_TI_NETWORKREGISTERFORPUSHNOTIFICATIONS\r\n\r\n- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo\r\n{\r\n\t// NOTE: this is called when the app is *running* after receiving a push notification\r\n\t// otherwise, if the app is started from a push notification, this method will not be \r\n\t// called\r\n\tRELEASE_TO_NIL(remoteNotification);\r\n\t[self generateNotification:userInfo];\r\n\t\r\n\tif (remoteNotificationDelegate!=nil)\r\n\t{\r\n\t\t[remoteNotificationDelegate performSelector:@selector(application:didReceiveRemoteNotification:) withObject:application withObject:remoteNotification];\r\n\t}\r\n}\r\n{code}\r\n\r\nh4.Associated HD ticket\r\nAs an ENT customer relies on this, I set Customer priority to Immediate.\r\nhttp://appc.me/c/APP-919486\r\n\r\nh4.Additional info\r\nThe message is being sent to the device using Urban Airship. Let me know please if anymore data is needed.", "attachment": [], "flagged": false, "summary": "iOS: push notification callbacks invoked twice", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK: Mobile 1.7.2\r\nPlatform OS: iOS 4.x", "comment": { "comments": [ { "id": "161338", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "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:\n\nIf 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.\n\nFor 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.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-01T12:28:59.000+0000", "updated": "2011-08-01T12:28:59.000+0000" }, { "id": "412938", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the information that was requested was never provided.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-16T20:44:07.000+0000", "updated": "2017-03-16T20:44:07.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }