{ "id": "132358", "key": "TIMOB-18179", "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": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2017-10-25T21:59:16.000+0000", "created": "2014-06-27T18:26:06.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "TCSupportTriage", "ios", "mobile", "reprod", "titanium" ], "versions": [ { "id": "15971", "description": "Release 3.2.3", "name": "Release 3.2.3", "archived": false, "released": true, "releaseDate": "2014-04-30" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" }, { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" }, { "id": "16676", "description": "Release 3.4.1", "name": "Release 3.4.1", "archived": false, "released": true, "releaseDate": "2014-11-14" } ], "issuelinks": [ { "id": "55321", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "outwardIssue": { "id": "154238", "key": "TIMOB-20272", "fields": { "summary": "iOS: Interactive notifications with activationMode background don't work when app is not already in memory", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:41:08.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 Description\r\n1. Titanium mobile app doesn't fire \"resumed\" event at fresh launch. Based on Apple's doc, \"applicationDidBecomeActive:\" is called at fresh launch as well. Shouldn't \"resumed\" be fired at fresh launch?\r\n\r\n2. Based on #1, Shouldn't Titanium mobile app fire \"paused\" event when app is launched directly into the background? Since \"applicationDidEnterBackground:\" is called in this case.\r\n\r\n3. There is currently no way to determine whether app is launched into the foreground or the background with Titanium. It is possible with native code, according to Apple's Docs. This feature is highly needed.\r\n\r\n\r\nh4. Test case\r\n1. Create a new mobile project (Classic Titanium) \r\n2. Copy this code into app.js\r\n{code}\r\nvar main_window = Ti.UI.createWindow({\r\n\tbackgroundColor: 'green'\r\n});\r\nmain_window.open();\r\n\r\nTitanium.App.addEventListener('pause', function (e) {\r\n Ti.API.info('app.js: Pause event on '+Ti.Platform.osname);\r\n}); \r\nTitanium.App.addEventListener('paused', function (e) {\r\n Ti.API.info('app.js: Paused event on '+Ti.Platform.osname);\r\n}); \r\nTitanium.App.addEventListener('resume', function (e) {\r\n Ti.API.info('app.js: Resume event on '+Ti.Platform.osname);\r\n});\r\nTitanium.App.addEventListener('resumed', function (e) {\r\n Ti.API.info('app.js: Resumed event on '+Ti.Platform.osname);\r\n});\r\n{code}\r\n3. Run it into device\r\n\r\nh4. Extra info \r\n\r\nAccording to the \"Apple Doc\" The \"resumed\" event should also called at app fresh launch. According to Apple Doc [\"applicationDidBecomeActive\"|https://developer.apple.com/library/ios/documentation/uikit/reference/uiapplicationdelegate_protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/applicationDidBecomeActive:] is called at fresh launch, which invoke the Titanium.App \"resumed\" event. \r\n", "attachment": [], "flagged": false, "summary": "iOS: Missing app-state-events for fresh launch and background-launch", "creator": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 3.2.3 iOS 7\r\nCLI version 3.3.0\r\nTitanium SDK version 3.2.3.GA, 3.3.0.GA, 3.4.0.GA, 3.4.1.GA\r\n\r\niOS 7", "closedSprints": [ { "id": 963, "state": "closed", "name": "2017 Sprint 22 SDK", "startDate": "2017-10-22T21:43:59.523Z", "endDate": "2017-11-05T22:43:00.000Z", "completeDate": "2017-11-06T16:33:42.425Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "314765", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello [~shawnlan]!\r\n\r\nCan you please read this:\r\n\r\nhttp://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.App-event-resume\r\n\r\nand let us know if that covers 1 and 2, or if you need something else? Please check resume and resumed. \r\n\r\nBest Regards! ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-07-18T05:02:44.000+0000", "updated": "2014-07-18T05:02:44.000+0000" }, { "id": "314861", "author": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "No it doesn't cover 1 and 2. I know how \"resume\" and \"resumed\" events work in Titanium. My problem is that \"resumed\" (and probably \"paused\" too) event doesn't work as intended. That is, at \"fresh launch\" (not resumed from the background), the \"resumed\" event is not fired. According to Apple's doc, \"applicationDidBecomeActive:\" is called at \"fresh launch\" as well. Titanium's \"resumed\" event should go together with \"applicationDidBecomeActive,\" right? I don't understand why it's not, and am curious about how its implementation looks like.\r\n\r\n", "updateAuthor": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-07-18T19:22:10.000+0000", "updated": "2014-07-18T19:22:10.000+0000" }, { "id": "423236", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This issue is valid and will be addressed, as soon as TIMOB-20272 is merged. The reason it happens is because the notification is sent before {{Ti.App}} namespace is registering for the event, so the notification gets lost in translation. Having TIMOB-20272 merged, we are able to send the event as soon as the app is ready. Same thing for the {{paused}} event for app's launched in the background (e.g. for background-services or remote push notifications).", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-30T07:49:08.000+0000", "updated": "2017-06-30T07:49:08.000+0000" }, { "id": "429611", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Tested on latest master and it works already, see the linked fix above.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-25T21:59:16.000+0000", "updated": "2017-10-25T21:59:16.000+0000" }, { "id": "439988", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as a duplicate. If this is in error, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:41:08.000+0000", "updated": "2018-08-06T17:41:08.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }