{ "id": "81126", "key": "TIMOB-5437", "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": "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2013-02-14T00:57:16.000+0000", "created": "2011-10-05T06:39:36.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam" ], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [ { "id": "24474", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "64160", "key": "TIMOB-3528", "fields": { "summary": "iOS: Distinguishing between remote push notifications ", "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": "Trivial", "id": "5" }, "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-22T22:08:05.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.Feature\r\nExpose the applicationState property through Titanium API so we can know the application was frontmost when it received a notification.\r\n\r\nhttp://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/applicationState\r\n\r\nh5.Customer notes\r\nThe applicationState property is not exposed in titanium, thus, there is no way take proper action in response to a remote notification.\r\n\r\nSpecifically, if the app is in the background and receives a push notification, the notification popup displays, and when the app is launched from the popup, the messageCallback is invoked. There is no way to determine from within this callback whether the system had already displayed the popup to the user.\r\n\r\nh5.Associated HD ticket\r\nAPP-185982", "attachment": [], "flagged": false, "summary": "iOS: Expose applicationState property of UIApplication Class", "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": " Product: Mobile\r\n Titanium SDK: Mobile 1.7.2\r\n Platform OS: iOS 4.2", "comment": { "comments": [ { "id": "168033", "author": { "name": "tfischer", "key": "tfischer", "displayName": "Thomas Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In regards to the original need for exposing this state for remote notifications:\r\n\r\nIt seems that it may not possible to correctly inspect this state as specified in apple's documentation: \"application:didReceiveRemoteNotification:\" in the 'callback' method of the push notification handler.\r\n\r\nSpecifically, if we inspect the application state property within the push message callback, it may always return UIApplicationStateActive.\r\n\r\nPerhaps this is because the javascript push message handler gets invoked asynchronously after the didReceiveRemoteNotification has returned?\r\n\r\nFor this particular problem, it doesn't make sense to expose the applicationState if this problem is not fixed.\r\n\r\nI am going to perform additional tests to see if I can verify that this is in fact the behavior.\r\n\r\n", "updateAuthor": { "name": "tfischer", "key": "tfischer", "displayName": "Thomas Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-05T11:05:15.000+0000", "updated": "2011-10-05T11:14:10.000+0000" }, { "id": "168192", "author": { "name": "tfischer", "key": "tfischer", "displayName": "Thomas Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Nevermind my previous comment. The applicationState is in fact correct when receiving the push message callback within javascript. \r\n\r\nThat is, when the app is in the background, and the javascript callback is invoked, the applicationState is inactive. When it is in the foreground, the applicationState is active.\r\n\r\nExposing the applicationState should enable an application developer to determine if the app was in the background or foreground when the push message was originally received.", "updateAuthor": { "name": "tfischer", "key": "tfischer", "displayName": "Thomas Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-06T17:17:09.000+0000", "updated": "2011-10-06T17:17:09.000+0000" }, { "id": "238491", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-13T23:54:38.000+0000", "updated": "2013-02-13T23:54:38.000+0000" }, { "id": "238503", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Duplicate of TIMOB-3528", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-14T00:57:16.000+0000", "updated": "2013-02-14T00:57:16.000+0000" }, { "id": "253371", "author": { "name": "bsudbury", "key": "bsudbury", "displayName": "Ben Sudbury", "active": true, "timeZone": "Australia/Sydney" }, "body": "This Ticket should be reopened. It is currently not possible to detect the difference between a home button press and a sleep button press through events on ios.\r\n\r\nFor IOS lower than 5.0 this was possible because ONLY the pause event fired for a sleep button press whereas BOTH the pause and paused events fired for a home button press. Since 5.0 the same events fire for both of these situations and the only way to tell the difference between the two is to inspect the applicationState property.\r\n\r\nSee http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.App\r\n\r\nAn example of an app that needs this is one that plays audio in the background. When the screen is locked, the audio should continue to play, but when the user deliberately navigates away from the app, the audio should be stopped or paused.\r\n\r\nPlease let me know that you acknowledge this comment or I will have to assume it is lost (due to being on a closed issue) and I will create a new issue with the same details.\r\n\r\nRegards,\r\n\r\n\r\nBen", "updateAuthor": { "name": "bsudbury", "key": "bsudbury", "displayName": "Ben Sudbury", "active": true, "timeZone": "Australia/Sydney" }, "created": "2013-05-22T04:04:37.000+0000", "updated": "2013-05-22T04:04:37.000+0000" }, { "id": "415084", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate and links to the related ticket have been provided above.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T22:08:05.000+0000", "updated": "2017-03-22T22:08:05.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }