{ "id": "64160", "key": "TIMOB-3528", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15272", "description": "2013 Sprint 04 API", "name": "2013 Sprint 04 API", "archived": true, "released": true, "releaseDate": "2013-02-25" }, { "id": "14814", "description": "2013 Sprint 04", "name": "2013 Sprint 04", "archived": true, "released": true, "releaseDate": "2013-02-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-02-13T23:55:38.000+0000", "created": "2011-04-15T03:46:20.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "CLA", "defect", "ios", "notifications", "push", "rplist" ], "versions": [], "issuelinks": [ { "id": "24474", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "81126", "key": "TIMOB-5437", "fields": { "summary": "iOS: Expose applicationState property of UIApplication Class", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T18:25:44.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": "{html}
Problem
\r\nWhen an app is running and a remote push notification is\r\nreceived, the callback passed to\r\nTi.Network.registerForPushNotifications is called. This is\r\nfine.
\r\nWhen an app is NOT running and a remote push notification is\r\nreceived, if the user taps \"View\" to open the app, the callback is\r\nalso called, but NOTHING is included in the event to indicate that\r\nthis notification was already displayed to the user and the app was\r\nlaunched via the \"View\" button. Thus, the app displays the\r\nnotification that the user has already seen.
\r\nThere are three possible cases:
\r\nSuggested Obj-C Fix
\r\n\r\nFROM:\r\n\r\n // check to see upon registration if we were started with a push \r\n // notification and if so, go ahead and trigger our callback\r\n id currentNotification = [[TiApp app] remoteNotification];\r\n if (currentNotification!=nil && pushNotificationCallback!=nil)\r\n {\r\n id event = [NSDictionary dictionaryWithObject:currentNotification forKey:@\"data\"];\r\n [self _fireEventToListener:@\"remote\" withObject:event listener:pushNotificationCallback thisObject:nil];\r\n }\r\n\r\nTO:\r\n\r\n // check to see upon registration if we were started with a push \r\n // notification and if so, go ahead and trigger our callback\r\n id currentNotification = [[TiApp app] remoteNotification];\r\n if (currentNotification!=nil && pushNotificationCallback!=nil)\r\n {\r\n id event = [NSDictionary dictionaryWithObjectsAndKeys:currentNotification, @\"data\", NUMBOOL(YES), @\"firedFromRegister\", nil];\r\n [self _fireEventToListener:@\"remote\" withObject:event listener:pushNotificationCallback thisObject:nil];\r\n }
\r\n
\r\nSee Ticket Reference for more Detail: http://support.appcelerator.com/tickets/EBJ-28594-463