{ "id": "61989", "key": "TIMOB-1357", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-25T12:04:05.000+0000", "created": "2011-04-15T02:50:20.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [], "versions": [ { "id": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "issuelinks": [ { "id": "19400", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "94532", "key": "TIMOB-9901", "fields": { "summary": "TiAPI: Review and clean up platform bugs and reduce bug count by 20%.", "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": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-26T22:26:32.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}
The App's close event is not fired under iOS4.
\r\nIf you press the home button, double click the home button and\r\nclose the app from the \"running tasks\" bar (which is the way to\r\nreally close an app under iOS4) no log output appears and no\r\nproperties are saved with this code:
\r\n\r\nTi.App.addEventListener('close',function() {\r\n Ti.API.info(\"Saving close event info\");\r\n Ti.App.Properties.setInt('closeevent', 1);\r\n});
\r\n
\r\nDont't mix up with #982 - this is a iOS4 problem. The above code\r\nworks with iPhone OS 3.2.
\r\nTested in simulator and on device.
Note that the operating system does not actually inform a\nsuspended application when it gets terminated -- there is no way to\ncatch this condition. Apps need to perform all their cleanup when\nthey're informed that they're being suspended; if an event isn't\ncurrently fired for that, it really needs to be.
Thank you for your appraisal. In this case, maybe the close\nevent should by fired on suspension for iOS4 -- for\ncompatibility.
\nFor now: there is no documented event for suspension to make a\nworkaround for this issue -- am I missing something?
Firing close on suspend is probably a bad idea, since apps are\nlikely to assume that 'close' means their code will DEFINITELY not\ncome back and they may do things like closing out windows and UI\nelements; the result would be a broken app if it's reactivated.
\nI'm not aware offhand of a suspend event existing yet (I'm not a\nmember of the development team, just another user.)
Because of how the shutdown framework works there is no\nguarantee this event listener will ever even be fired. Requires\nR&D, going to bump.