{ "id": "80385", "key": "TIMOB-5296", "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": "12077", "description": "", "name": "Sprint 2011-37", "archived": true, "released": true, "releaseDate": "2011-09-19" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2011-09-21T12:45:19.000+0000", "created": "2011-09-16T16:35:54.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T21:10:30.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": "When an application is backgrounded, iOS takes a screenshot of the app and uses it in its animation. This screenshot it stored on the filesystem of the device. The user wants to hide sensitive information from the screen before this screenshot is taken. When this is done in Titanium, iOS takes the screenshot before anything in the pause event listener is run. In a native app, it runs fast enough to change the label before the screenshot is taken.\r\n\r\nStep 1: run the code below\r\nStep 2: hit the home button\r\nStep 3: go look at the screenshot that was taken. \r\n(my screenshot was in \"/Users/jalter/Library/Application Support/iPhone Simulator/4.3.2/Applications/4BF6EF8F-5523-421A-8FE8-6793B79CD3F3/Library/Caches/Snapshots/com.appcelerator.test3\")\r\nStep 4: we want the screenshot to say \"App has been paused\", but the label change does not happen fast enough.\r\n\r\n\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : 'white',\r\n\torientationModes : [Ti.UI.PORTRAIT]\r\n});\r\nwin.open();\r\n\r\nvar label = Ti.UI.createLabel({\r\n\ttext : 'No app event received. Make call while running app',\r\n\ttextAlign : 'center',\r\n\twidth : 'auto'\r\n});\r\nwin.add(label);\r\n\r\nTitanium.App.addEventListener('pause', function() {\r\n\tlabel.text = \"App has been paused\";\r\n});\r\n\r\nTitanium.App.addEventListener('resume', function(e) {\r\n\tlabel.text = \"App has resumed\";\r\n});\r\n{code}\r\n\r\nh4. Associated Helpdesk Ticket\r\nhttp://appc.me/c/APP-822958", "attachment": [], "flagged": false, "summary": "iOS: app pause event is fired after the os has taken a snapshot of the app", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 1.7.2\r\niOS Simulator 4.3", "comment": { "comments": [ { "id": "166583", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "h4. Workaround\r\n{code}\r\n// by Blain Hamon\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : 'white',\r\n orientationModes : [Ti.UI.PORTRAIT]\r\n});\r\nwin.open();\r\n\r\nvar label = Ti.UI.createLabel({\r\n text : 'No app event received. Make call while running app',\r\n textAlign : 'center',\r\n width : 'auto'\r\n});\r\nwin.add(label);\r\n\r\nTitanium.App.addEventListener('pause', function() {\r\n// this will delete the Snapshots folder and create a file in its place \r\n// so that the folder cannot be recreated\r\n var snapFolder = Ti.Filesystem.getFile(Ti.Filesystem.applicationSupportDirectory,\"../Caches/Snapshots\");\r\n snapFolder.deleteDirectory(true);\r\n snapFolder.write(\"No Folder for you!\");\r\n label.text = \"App has been paused\";\r\n});\r\n\r\nTitanium.App.addEventListener('resume', function(e) {\r\n label.text = \"App has resumed\";\r\n});\r\n{code}", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-21T17:11:32.000+0000", "updated": "2011-09-21T17:11:32.000+0000" }, { "id": "197964", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "There is almost no way to guarantee that the UI will be updated from the JS thread in time on the pause/paused event. Titanium documentation clearly states that.\r\n\r\nThe only way to implement this functionality would be in the native code itself. A simple solution would be to pop up a UIView (maybe just the splash screen with the default image) in front of everything else and obscure the app. This would kind of make sure that the snapshot taken by iOS does not have any sensitive information. The drawback is that the obscuring a view would be visible to the users momentarily when the app boots up and before we can remove it from the view heirarchy.\r\n\r\nWe could drive this off of an app property (defined in tiapp.xml) or a runtime property (Ti.App.Properties.setString) so that the obscuring of data could be on a per screen basis.\r\n", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-10T19:18:04.000+0000", "updated": "2012-06-10T19:18:04.000+0000" }, { "id": "414961", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as \"Won't Fix\".", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T21:10:30.000+0000", "updated": "2017-03-22T21:10:30.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }