{ "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\n

If 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\n

Dont't mix up with #982 - this is a iOS4 problem. The above code\r\nworks with iPhone OS 3.2.

\r\n

Tested in simulator and on device.

{html}", "attachment": [], "flagged": false, "summary": "iOS: App Close event on IOS4 not fired", "creator": { "name": "gero", "key": "gero", "displayName": "gero", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "gero", "key": "gero", "displayName": "gero", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "125445", "author": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

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.

{html}", "updateAuthor": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:50:20.000+0000", "updated": "2011-04-15T02:50:20.000+0000" }, { "id": "125446", "author": { "name": "gero", "key": "gero", "displayName": "gero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thank you for your appraisal. In this case, maybe the close\nevent should by fired on suspension for iOS4 -- for\ncompatibility.

\n

For now: there is no documented event for suspension to make a\nworkaround for this issue -- am I missing something?

{html}", "updateAuthor": { "name": "gero", "key": "gero", "displayName": "gero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:50:21.000+0000", "updated": "2011-04-15T02:50:21.000+0000" }, { "id": "125447", "author": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

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.

\n

I'm not aware offhand of a suspend event existing yet (I'm not a\nmember of the development team, just another user.)

{html}", "updateAuthor": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:50:21.000+0000", "updated": "2011-04-15T02:50:21.000+0000" }, { "id": "125448", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

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.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:50:21.000+0000", "updated": "2011-04-15T02:50:21.000+0000" }, { "id": "209355", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with app with {{UIApplicationExitsOnSuspend = YES}} (required for iOS 4.0+). Unable to reproduce in SDK 2.2.0.f9e938d, iPhone Sim 5.1.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-25T12:04:05.000+0000", "updated": "2012-07-25T12:04:05.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }