{ "id": "137252", "key": "AC-1079", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-08-28T03:18:01.000+0000", "created": "2014-09-26T09:50:16.000+0000", "labels": [ "TCSupportTriage" ], "versions": [], "issuelinks": [], "assignee": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "updated": "2016-03-08T07:37:25.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "While trying out the release candidate of SDK 3.4.0 we noticed that one of our features which opens the device camera by pressing a button in a popover does not work anymore. This is only reproducible when running our app built with 3.4.0RC SDK on a device that has iOS 8.0 installed.\r\nAfter doing some investigation, we've discovered that this might have something to do with a window being modal. Below you can find a code snipped that illustrates the problem. There are 2 buttons, one opening the camera and other opening a modal window in the popover. While the camera problem can be only reproduced on a device (because of the hardware constraints), the issue with the modal window can be also reproduced on the simulator.\r\n\r\n{code:title=app.js|borderStyle=solid}\r\n(function() {\r\n var win = Ti.UI.createWindow({\r\n backgroundColor : 'white'\r\n });\r\n\r\n var view = Ti.UI.createView();\r\n\r\n var button = Ti.UI.createButton({\r\n title : \"Open Popover\",\r\n bottom : 10\r\n });\r\n button.addEventListener('click', function(e) {\r\n popover.show({\r\n view : button\r\n });\r\n });\r\n\r\n // popover construction\r\n var openCameraBtn = Ti.UI.createButton({\r\n title : \"Open Camera\",\r\n top : 50\r\n });\r\n openCameraBtn.addEventListener('click', function(e) {\r\n popover.hide();\r\n openCamera();\r\n });\r\n\r\n var openAnotherWindowBtn = Ti.UI.createButton({\r\n title : \"Open Another Window\",\r\n top : 150\r\n });\r\n openAnotherWindowBtn.addEventListener('click', function(e) {\r\n popover.hide();\r\n openModalWindow();\r\n });\r\n\r\n // popover content window\r\n var contentWindow = Ti.UI.createWindow({\r\n backgroundColor : 'green',\r\n title : 'Content Window',\r\n width : 250,\r\n height : 500\r\n });\r\n contentWindow.add(openCameraBtn);\r\n contentWindow.add(openAnotherWindowBtn);\r\n\r\n var popover = Ti.UI.iPad.createPopover({\r\n width : 250,\r\n height : 500,\r\n contentView : Ti.UI.iOS.createNavigationWindow({\r\n window : contentWindow\r\n })\r\n });\r\n\r\n popover.addEventListener('hide', function() {\r\n // if camera/modal window is opened here everything works OK\r\n });\r\n\r\n view.add(button);\r\n win.add(view);\r\n\r\n win.open();\r\n\r\n function openCamera() {\r\n Titanium.Media.showCamera({\r\n success : function(event) {\r\n alert('Success!');\r\n },\r\n cancel : function() {\r\n alert('Cancel!');\r\n },\r\n error : function(error) {\r\n alert('Error occured!');\r\n },\r\n saveToPhotoGallery : false,\r\n allowEditing : false,\r\n mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]\r\n });\r\n }\r\n\r\n function openModalWindow() {\r\n var win = Ti.UI.createWindow({\r\n backgroundColor : 'orange',\r\n modal : true\r\n });\r\n var btn = Ti.UI.createButton({\r\n title : \"Close Window\",\r\n });\r\n btn.addEventListener('click', function() {\r\n win.close();\r\n });\r\n win.add(btn);\r\n win.open();\r\n }\r\n\r\n})();\r\n{code}\r\n\r\nIn the console warnings like the ones below show up:\r\n{code}\r\nWarning: Attempt to present on whose view is not in the window hierarchy!\r\nWarning: Attempt to present on whose view is not in the window hierarchy!\r\n{code}\r\n\r\n\r\nThere is a workaround for the above problem by using a mechanism that will open the camera/modal window in the 'hide' event listener registered on the popover. However we doubt that it is intended to be used like that.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Unable to open the camera from a popover on iOS8 with SDK 3.4.0 RC ", "creator": { "name": "ivo.tasevski", "key": "ivo.tasevski", "displayName": "Ivo", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ivo.tasevski", "key": "ivo.tasevski", "displayName": "Ivo", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "OSX: 10.9.5\r\nXCode: 6.0.1\r\nTitanium Studio: 3.4.0.201409161931\r\nTitanium SDK 3.4.0.v20140916181713", "comment": { "comments": [ { "id": "361415", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nWe tested the issue you reported. And we can open the camera from a popover on iOS 8 with this following environment.\r\n*Result:* Not a platform.\r\n\r\nSo I recommend you upgrade studio and SDK version to the latest build and let us know if you get the same warnings again.\r\n\r\n*Steps To Test*\r\n1. Paste that code in app.js file.\r\n2. Then run with the testing environment.\r\n\r\n*Testing Environment:*\r\nCommand-Line Interface, version 4.1.2,\r\nTi SDK: 4.1.0.GA,\r\niOS version: iPad mini (v8.1.1), \r\nOS X Version: 10.10.4, \r\nAppcelerator Studio: 4.1.1\r\n\r\n\r\n*Test code*\r\nReporter's Test Code\r\nThanks.", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-08-27T11:11:19.000+0000", "updated": "2015-08-28T03:17:24.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }