{ "id": "66113", "key": "TIMOB-4538", "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": [ { "id": "12095", "description": "", "name": "Sprint 2012-03", "archived": true, "released": true, "releaseDate": "2012-02-12" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" }, { "id": "13170", "name": "Sprint 2012-06", "archived": true, "released": true, "releaseDate": "2012-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-03-29T01:00:34.000+0000", "created": "2011-06-03T23:22:53.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "module_webview", "parity", "qe-3.2.1", "qe-testadded", "webview" ], "versions": [], "issuelinks": [ { "id": "14780", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "62174", "key": "TIMOB-1542", "fields": { "summary": "iOS: 'pause' and 'resume' events don't seem to fire correctly", "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 } } } }, { "id": "15133", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "62174", "key": "TIMOB-1542", "fields": { "summary": "iOS: 'pause' and 'resume' events don't seem to fire correctly", "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": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-03-29T01:00:39.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": "first try:\r\n\r\nx.js\r\n{code}\r\nTi.UI.createWebView({ url:'y.html' });\r\n{code}\r\n\r\ny.html:\r\n{code}\r\nTi.App.addEventListener('pause', function() { Ti.API.log('you won't see this message'); });\r\n{code}\r\n\r\nupon pausing the app, the handler does not get invoked. i then tried another alternative:\r\n\r\nx.js\r\n{code}\r\nTi.UI.createWebView({ url:'y.html' });\r\nTi.App.addEventListener('pause', function() { Ti.API.log('ok, fire'); Ti.App.fireEvent('app.pause'); });\r\n{code}\r\n\r\ny.html:\r\n{code}\r\nTi.App.addEventListener('app.pause', function() { Ti.API.log('you won't see this message either'); });\r\n{code}\r\n\r\nthis time the pause event gets caught, 'app.pause' gets fired, but still the webview stays silent. somehow this leads me to the conclusion that webviews won't receive events after an app entered the 'pause' state, because other event handlers work just fine while the app is in running mode.\r\n\r\nA complete usecase supplied by Rick Blalock:\r\n\r\n{code:lang=javascript}\r\nvar webview = Ti.UI.createWebView({\r\n url: \"test.html\"\r\n})\r\n\r\nvar win = Ti.UI.createWindow();\r\n\r\nwin.add(webview);\r\nwin.open();\r\n\r\nTi.App.addEventListener(\"pause\", function() {\r\n Ti.API.info(\"Pause event received\");\r\n Ti.App.fireEvent(\"appPaused\");\r\n});\r\n\r\nTi.App.addEventListener(\"appPaused\", function() {\r\n Ti.API.info(\"App.js received appPaused event\");\r\n});\r\n{code}\r\n\r\n{code:lang=html}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n{code}", "attachment": [ { "id": "21151", "filename": "app.js", "author": { "name": "matthewcongrove", "key": "matthewcongrove", "displayName": "Matthew Congrove", "active": true, "timeZone": "America/Chicago" }, "created": "2011-06-14T07:55:46.000+0000", "size": 346, "mimeType": "application/x-javascript" }, { "id": "21152", "filename": "test.html", "author": { "name": "matthewcongrove", "key": "matthewcongrove", "displayName": "Matthew Congrove", "active": true, "timeZone": "America/Chicago" }, "created": "2011-06-14T07:55:46.000+0000", "size": 215, "mimeType": "text/html" } ], "flagged": false, "summary": "iOS: WebView does not receive 'pause' event", "creator": { "name": "tom", "key": "tom", "displayName": "tom quas", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "tom", "key": "tom", "displayName": "tom quas", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Ti 1.7.0 GA\r\niOS 4.3", "comment": { "comments": [ { "id": "155814", "author": { "name": "tom", "key": "tom", "displayName": "tom quas", "active": true, "timeZone": "Europe/Berlin" }, "body": "tried to rearrange code, but even a webview.evalJS() as the first in the pause handler won't be executed. looks like a webview gets unresponsive right away upon pause events?", "updateAuthor": { "name": "tom", "key": "tom", "displayName": "tom quas", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-06-09T00:55:13.000+0000", "updated": "2011-06-09T00:55:13.000+0000" }, { "id": "156589", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Tom\r\n\r\nIn order for us to progress this issue, please edit your ticket to include a proper [Use-case|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases].\r\n\r\nAlso, please do the following:\r\n\r\n* use the wiki markup provided, to format the ticket correctly\r\n* include the Titanium SDK version + build date + build hash\r\n* include the iOS version tested\r\n\r\nThank you", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-06-13T08:59:57.000+0000", "updated": "2011-06-13T08:59:57.000+0000" }, { "id": "156710", "author": { "name": "matthewcongrove", "key": "matthewcongrove", "displayName": "Matthew Congrove", "active": true, "timeZone": "America/Chicago" }, "body": "Attaching repro code as per customer request, outlining customer's method.\r\n\r\nTested using 1.7.0, iOS 4.3 on June 14.", "updateAuthor": { "name": "matthewcongrove", "key": "matthewcongrove", "displayName": "Matthew Congrove", "active": true, "timeZone": "America/Chicago" }, "created": "2011-06-14T07:55:46.000+0000", "updated": "2011-06-14T07:56:29.000+0000" }, { "id": "157633", "author": { "name": "tom", "key": "tom", "displayName": "tom quas", "active": true, "timeZone": "Europe/Berlin" }, "body": "Paul, can you reproduce the issue using Matthew's code? Is there anything else I can provide?", "updateAuthor": { "name": "tom", "key": "tom", "displayName": "tom quas", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-06-23T05:33:17.000+0000", "updated": "2011-06-23T05:33:17.000+0000" }, { "id": "157638", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Tom\r\n\r\nOnce you have gone through the three points I have listed above, and also moved the environment information to the environment field, I will be happy to transfer this ticket to the relevant project.\r\n\r\nNote that, for such a small usecase, it would be better to have the code in the ticket, properly formatted, than in attachments.\r\n\r\nThanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-06-23T06:36:37.000+0000", "updated": "2011-06-23T06:36:37.000+0000" }, { "id": "157640", "author": { "name": "tom", "key": "tom", "displayName": "tom quas", "active": true, "timeZone": "Europe/Berlin" }, "body": "Paul,\r\n\r\nthis issue has been tagged ios, 4.3, webview; env has been declared 1.6.2, your colleague from pro support attached the code necessary to reproduce the problem, he mentioned that he can reproduce the issue w/ Ti 1.7, too.\r\n\r\nat this point i do not know what else to provide.\r\nthx", "updateAuthor": { "name": "tom", "key": "tom", "displayName": "tom quas", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-06-23T07:39:29.000+0000", "updated": "2011-06-23T07:39:29.000+0000" }, { "id": "158324", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "Better?\r\n\r\n{code}\r\nvar webview = Ti.UI.createWebView({\r\n url: \"test.html\"\r\n})\r\n\r\nvar win = Ti.UI.createWindow();\r\n\r\nwin.add(webview);\r\nwin.open();\r\n\r\nTi.App.addEventListener(\"pause\", function() {\r\n Ti.API.info(\"Pause event received\");\r\n Ti.App.fireEvent(\"appPaused\");\r\n});\r\n\r\nTi.App.addEventListener(\"appPaused\", function() {\r\n Ti.API.info(\"App.js received appPaused event\");\r\n});\r\n{code}\r\n\r\n{code}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n{code}", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-06-30T08:55:28.000+0000", "updated": "2011-06-30T08:55:28.000+0000" }, { "id": "166713", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Aha. What's going on is that when the pause event's underlying notification fires, the main run loop is stopped. So any performSelectorOnMainThread won't happen until resume.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-22T17:54:41.000+0000", "updated": "2011-09-22T17:54:41.000+0000" }, { "id": "181547", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Interesting. This may prove nontrivial for web views. Even with running things on the main thread with our own override, the web view fails to process commands.\r\n\r\nWhen we try to jury-rig things by calling [[NSRunLoop mainRunLoop] runUntilDate:deadline] during the application shutdown sequence, it ends up calling the app shutdown sequence again, leading to an ugly infinite loop.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-02T18:03:52.000+0000", "updated": "2012-02-02T18:03:52.000+0000" }, { "id": "182772", "author": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as Fixed.\r\nSDK: 1.9.0.v20120210100134\r\nStudio: 1.0.8.201201262211\r\nOS: Lion\r\nDevices Tested: iPhone Simulator 5.0, iPod 4.3.3, iPad2 4.3.5, iPhone4 5.0.1", "updateAuthor": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-10T11:54:05.000+0000", "updated": "2012-02-10T11:54:05.000+0000" }, { "id": "186051", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening as part of PR #1597 (https://github.com/appcelerator/titanium_mobile/pull/1597) omnibus.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-12T13:43:46.000+0000", "updated": "2012-03-12T13:43:46.000+0000" }, { "id": "186266", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Combined pull #1597 + #1645", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-13T12:13:58.000+0000", "updated": "2012-03-13T12:13:58.000+0000" }, { "id": "186429", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug. Verified fix on:\r\n\r\nSDK build: 2.0.0.v20120314090311\r\nTitanium Studio, build: 2.0.0.201203132050\r\nxcode: 4.2\r\nDevice: iphone 4s (5.0.1)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-14T09:54:25.000+0000", "updated": "2012-03-14T09:54:25.000+0000" }, { "id": "266393", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening since pause event not being fired on Android.\r\nWorks well on ios. Checked with ipad mini(v6.0).\r\nReopened this bug,as does not specify any specific platform.\r\n\r\n\r\nNot a regression.\r\n\r\nVerified with:\r\n\r\nStudio: 3.1.2.201308091728\r\nSDK: 3.1.2.v20130813151607\r\nacs:1.0.5\r\nalloy:1.2.0-alpha6\r\ntitanium:3.1.2-alpha\r\ntitanium-code-processor:1.0.2-alpha\r\nOS: OSX 10.8.4\r\nDevice: Nexus 7(v4.2.1)\r\nXcode:4.6.3\r\n\r\n", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-14T08:11:38.000+0000", "updated": "2013-08-14T08:11:38.000+0000" }, { "id": "299246", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.App-event-pause\n\nTi.App.addEventListener(\"pause\",function()) is only supported for iOS, not Android.\nClosing.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-29T01:00:26.000+0000", "updated": "2014-03-29T01:00:26.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }