{ "id": "84416", "key": "TIMOB-6994", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "14065", "description": "Sprint 2012-17 API", "name": "Sprint 2012-17 API", "archived": true, "released": true, "releaseDate": "2012-08-27" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-08-29T16:19:08.000+0000", "created": "2012-01-03T08:45:24.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "module_alertdialog", "qe-review", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "20454", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "100157", "key": "TIMOB-10710", "fields": { "summary": "Android: Add persistent property support to Titanium.UI.AlertDialog and Titanium.UI.OptionDialog", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-09-07T09:52:45.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": "h2.Problem\r\n\r\nBack from a standby phone, [Titanium.UI.AlertDialog|http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.AlertDialog-object] is no longer displayed on the screen.\r\n\r\nh2.Test Case\r\n\r\nIn the iOS device\r\n\r\n* Run the code below\r\n* The \"Alert Dialog\" opens\r\n* Lock the phone\r\n* Unlock the phone\r\n* The \"Alert Dialog\" is no longer present\r\n\r\n\r\n{code:lang=javascript|title=app.js}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n});\r\n\r\nvar alertDialog = Titanium.UI.createAlertDialog({\r\n\ttitle : \"Title\",\r\n\tmessage : \"Message\",\r\n\tbuttonNames : [\"Yes\", \"No\"]\r\n});\r\nalertDialog.show();\r\n\t\r\ntabGroup.addTab(tab1); \r\n\r\ntabGroup.open();\r\n{code} \r\n\r\n", "attachment": [], "flagged": false, "summary": "iOS: UI - AlertDialog needs to be displayed after locking & unlocking the phone", "creator": { "name": "toutspeed", "key": "toutspeed", "displayName": "Anthony", "active": true, "timeZone": "Europe/Paris" }, "subtasks": [], "reporter": { "name": "toutspeed", "key": "toutspeed", "displayName": "Anthony", "active": true, "timeZone": "Europe/Paris" }, "environment": "* Titanium Mobile 1.8.0.1 (12/22/11 13:09 fbdc96f)\r\n* iOS 4.3.5\r\n* iPhone device\r\n* iPhone 4\r\n", "comment": { "comments": [ { "id": "178093", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Thank you for taking the trouble to raise this ticket with such care, Anthony - it's perfect! :)\r\n\r\nJust so that you are aware, you were looking at version 1.2 of the apidocs. The latest version is always at http://developer.appcelerator.com/apidoc/mobile/latest. Let me know if there is an erroneous link on our site, and I will correct it.\r\n\r\nI will escalate this ticket now.\r\n\r\nCheers", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-05T06:12:07.000+0000", "updated": "2012-01-05T06:12:07.000+0000" }, { "id": "178102", "author": { "name": "toutspeed", "key": "toutspeed", "displayName": "Anthony", "active": true, "timeZone": "Europe/Paris" }, "body": "Thank you for correcting the link.\r\nDo you know in how long this bug will be fixed there?", "updateAuthor": { "name": "toutspeed", "key": "toutspeed", "displayName": "Anthony", "active": true, "timeZone": "Europe/Paris" }, "created": "2012-01-05T07:21:15.000+0000", "updated": "2012-01-05T07:21:15.000+0000" }, { "id": "189922", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "An HD ticket about this issue: http://support.appcelerator.com/tickets/APP-445384", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-04-05T05:53:23.000+0000", "updated": "2012-04-05T05:53:23.000+0000" }, { "id": "190322", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is actually intentional design, due to [Apple's comment|https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIAlertView_Class/UIAlertView/UIAlertView.html]\r\n\r\n{quote}\r\nImportant In iOS 4.0 and later, alert views are not dismissed automatically when an application moves to the background. This behavior differs from earlier versions of the operating system, where alert views were automatically cancelled (and their cancellation handler executed) as part of the termination sequence for the application. Now, it is up to you to decide whether to dismiss the alert view (and execute its cancellation handler) or leave it visible for when your application moves back to the foreground. Remember that your application can still be terminated while in the background, so some type of action may be necessary in either case.\r\n{quote}\r\n\r\nWe do run risks of regression if we change this behavior, but I'm not sure which behavior we should adhere to going forward.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-09T09:36:35.000+0000", "updated": "2012-04-09T09:36:35.000+0000" }, { "id": "190324", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Seems like the relevant text is: *In iOS 4.0 and later*\r\n\r\nSo if the iOS version is >= 4.0, don't hide the alert. If the iOS version is < 4.0, keep hiding it.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-04-09T09:45:16.000+0000", "updated": "2012-04-09T09:45:16.000+0000" }, { "id": "190326", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We no longer support iOS < 4.0 so this shouldn't be a problem.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-09T09:51:49.000+0000", "updated": "2012-04-09T09:51:49.000+0000" }, { "id": "190801", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The point being that when the version of iOS was < 4.0, we had no control over it, the OS hid the alert. During the time when we supported 3 and 4, for consistency's sake, we'd match the behavior. The issue isn't about 4.0 or not anymore, it's that this asks for a behavior change of an intentional behavior. Changing it without considering this would be a regression for everyone else.\r\n\r\nThe reasoning for this was because AlertDialogs are meant for short term decisions. And if an application goes into the background (Not just locking, but fully background) there's a chance that you wouldn't get any sort of callback as the app may quit. I do want to poke about and do some research on a happy medium, but this is why I'm hesitant to simply change the behavior.\r\n\r\nIn the mean time, note that listening for an app resume would give you time to reinstate or update the alert, or if this is something that requires user input, a modal window may be a better way to express it.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-12T15:07:10.000+0000", "updated": "2012-04-12T15:07:10.000+0000" }, { "id": "190818", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Followup: Unfortunately, the research was thus. In native iOS, there's two methods called to the Application Delegate, one called applicationWillResignActive (which has been around since iOS 2.0) and one called applicationDidEnterBackground (which replaced applicationWillTerminate in iOS 4.0). In 3.0, locking the screen would trigger willResignActive, but not applicationWillTerminate. I was hoping that 4.0 would be similar, but it's not: it calls both willResignActive and applicationDidEnterBackground.\r\n\r\nShort version: Locking the screen is the same as exiting to home, and we can't tell the difference.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-12T16:10:20.000+0000", "updated": "2012-04-12T16:10:20.000+0000" }, { "id": "190848", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "OK, so if the user \"Home\"s away from the app (or the screen locks), then resumes the app, I'd want to see the AlertDialog again. I understand that this would be different behavior, so what about adding a new property to AlertDialog (perhaps persistent:true) to accomplish this?\r\n\r\nAnd OK, this is not a bug, technically. Can this JIRA be turned into a new feature request?", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-04-13T05:34:17.000+0000", "updated": "2012-04-13T05:34:17.000+0000" }, { "id": "190951", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Moving this a to a feature request. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2012-04-13T14:48:13.000+0000", "updated": "2012-04-13T14:48:13.000+0000" }, { "id": "208887", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "We already expose pause, paused, resume and resumed events on IOS. This can be done in the code itself by acting appropriately based on these events. ", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-07-23T10:18:36.000+0000", "updated": "2012-07-23T10:18:36.000+0000" }, { "id": "208897", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Vishal, using the pause, paused, resume, and resumed events would mean setting up at least two of these event listeners every time an AlertDialog is presented to the user (and then removing the event listeners afterward). That seems a little clumsy. This request is for Titanium to handle this for the app.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-07-23T10:53:03.000+0000", "updated": "2012-07-23T10:53:03.000+0000" }, { "id": "215514", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Testing Code\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n \r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n \r\nvar win1 = Titanium.UI.createWindow({  \r\n    title:'Tab 1',\r\n    backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({  \r\n    icon:'KS_nav_views.png',\r\n    title:'Tab 1',\r\n    window:win1\r\n});\r\nvar button1 = Ti.UI.createButton({\r\n\ttitle: 'normal alert',\r\n\ttop: 30,\r\n\theight:Ti.UI.SIZE,\r\n\twidth:Ti.UI.SIZE\r\n});\r\nbutton1.addEventListener('click',function(){\r\n\r\n\tvar alertDialog = Titanium.UI.createAlertDialog({\r\n\t    title : \"Alert Dialog\",\r\n\t    message : \"I will go away if you background the app. ;(\",\r\n\t    buttonNames : [\"Yes\", \"No\"],\r\n\t});\r\n\talertDialog.show();\r\n});\r\nvar button2 = Ti.UI.createButton({\r\n\ttitle: 'persistant alert',\r\n\ttop: 80,\r\n\theight:Ti.UI.SIZE,\r\n\twidth:Ti.UI.SIZE\r\n});\r\nbutton2.addEventListener('click',function(){\r\n\r\n\tvar alertDialog = Titanium.UI.createAlertDialog({\r\n\t    title : \"Alert Dialog\",\r\n\t    message : \"This Alert Should be persistant, I will not go away unless you cancel me!\",\r\n\t    buttonNames : [\"Yes\", \"No\"],\r\n\t\tpersistent : true,\r\n\t});\r\n\talertDialog.show();\r\n});\r\nvar label = Ti.UI.createLabel({\r\n\ttext:'Perfrom the following test.\\n1.Click on `normal alert`.\\n2.Without Cancelling the Alert background the app.\\n3.On reopening the alert should be hidden.\\n4.Click on persistant Alert\\n5.Follow step 2. and when you reopen the app the alert should be run.\\n6.If the second alert dialog still shows then the test is PASSED.',\r\n\theight:Ti.UI.SIZE,\r\n\twidth:Ti.UI.SIZE,\r\n\tbottom: 10\r\n})     \r\nwin1.add(label);\r\nwin1.add(button1);\r\nwin1.add(button2);\r\ntabGroup.addTab(tab1);  \r\n \r\ntabGroup.open();\r\n{code}\r\n\r\nh4.Testing Instruction\r\n1.Click on `normal alert`.\r\n2.Without Cancelling the Alert background the app.\r\n3.On reopening the alert should be hidden.\r\n4.Click on persistant Alert.\r\n5.Follow step 2. and when you reopen the app the alert should be run.\r\n6.If the second alert dialog still shows then the test is PASSED or else FAIL", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-21T19:11:44.000+0000", "updated": "2012-08-22T16:24:42.000+0000" }, { "id": "215515", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[Pull pending|https://github.com/appcelerator/titanium_mobile/pull/2804]", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-21T19:16:37.000+0000", "updated": "2012-08-21T19:17:24.000+0000" }, { "id": "215558", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Sabil, the \"persistant\" property you added is misspelled. The correct spelling is \"persistent\".", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-08-22T05:18:47.000+0000", "updated": "2012-08-22T05:18:47.000+0000" }, { "id": "215611", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "D'uh updating. Thanks Shawn. ", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-22T10:35:16.000+0000", "updated": "2012-08-22T10:35:16.000+0000" }, { "id": "217124", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Environment used for verification -\r\nTested with Titanium SDK: 2.2.0.v20120830182512\r\nTested with Titanium  Studio: 2.1.2.201208301612\r\nDevice - iPhone 3G S iOS 5.0.1,iPHONE 4S iOS 5.0.1\r\nMachine OS - MAC 10.8", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-31T01:41:27.000+0000", "updated": "2012-08-31T01:41:27.000+0000" } ], "maxResults": 19, "total": 19, "startAt": 0 } } }