{ "id": "147139", "key": "AC-846", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2015-04-22T07:04:02.000+0000", "created": "2015-04-22T07:01:32.000+0000", "labels": [ "ios" ], "versions": [], "issuelinks": [ { "id": "47384", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "146429", "key": "AC-759", "fields": { "summary": "Ti.Media.openPhotoGallery is not working on iPad but fine on iPhone", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "updated": "2016-03-08T07:37:08.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": "14545", "name": "Documentation" } ], "description": "Titanium.Media.openPhotoGallery is not working for iPads. \r\n\r\nSteps to reproduce:\r\n1. Create an app using the code below.\r\n2. Launch the test app.\r\n\r\nActual:\r\nNo photo gallery is invoked on iPads whereas photo gallery is successfully invoked on iPhones.\r\nExpected:\r\nPhoto gallery should be invoked on iPads as well.\r\n\r\n// ########## CODE STARTS HERE ########\r\n\r\nvar self = Titanium.UI.createWindow({\r\n\ttop : 0,\r\n\tnavBarHidden : true,\r\n\tbackgroundColor : \"#FFF\",\r\n\texitOnClose : false\t\r\n});\r\n\r\nvar leftView = Titanium.UI.createLabel({\r\n text : Click for Gallery\",\r\n\twidth : 80,\r\n\theight : 80,\r\n\tleft : 40,\r\n\ttop : 30,\r\n\tzIndex : 2\r\n\t}); \r\nself.add(leftView);\r\n\r\nleftView.addEventListener('click', OpenPhoneGallery);\r\n\r\nfunction OpenPhoneGallery(){\r\n\t\r\n\tTi.Media.openPhotoGallery({\r\n\t\tsuccess : function(ev) {\r\n\t\t\tSharePageCallFunc(ev);\r\n\t\t},\r\n\t\tcancel : function(){\r\n\t\t\talert(\"Gallery is not opened\");\r\n\t\t},\r\n\t\terror : function(err){\r\n\t\t\tvar a = Titanium.UI.createAlertDialog({\r\n\t\t\ttitle : 'Gallery'\r\n\t\t\t});\t\t\t\r\n\t\t\ta.setMessage('Unexpected error: ' + err.code);\t\t\r\n\t\t\ta.show();\r\n\t\t}, \r\n\t\t\r\n\t\t\tshowControls : false,\r\n\t\t\tmediaTypes : Ti.Media.MEDIA_TYPE_PHOTO,\r\n\t\t\tautohide : true \r\n\t\r\n\t});\r\n}\r\n\r\nfunction SharePageCallFunc(eve,hidecam){\r\n \t\t\t\r\n \t\tvar shareImageView = Ti.UI.createImageView({\r\n\t\twidth : Ti.UI.SIZE,\r\n\t\theight: Ti.UI.SIZE,\r\n\t\timage : eve.media,\t\t\r\n\t\tleft : 0,\r\n\t\ttop : 0,\r\n\t\tbottom : 0,\r\n\t\tautorotate:true,\r\n top : 100\r\n\t\t});\t\r\n \tself.add(shareImageView);\t\t\r\n\r\n }\r\n\r\nself.open();", "attachment": [], "flagged": false, "summary": "Ti.Media.openPhotoGallery is not working on iPad when using Camera Overlay but fine on iPhone", "creator": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "subtasks": [], "reporter": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "environment": "\r\nTested with:\r\nSDK: 3.4.0.GA\r\nStudio: 3.4.1.201410281727\r\nDevice: iPad mini(v 7.1), iPad2(v 8.2), iPhone5(v 8.2)", "comment": { "comments": [ { "id": "350348", "author": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi Team,\r\n\r\nI assume an issue happening because of opening GALLERY from OVERLAY of Camera,\r\nCan you please try to open the camera on overlay and then Add one Label/button there, And call the \r\nTi.Media.openPhotoGallery on that click event,\r\n\r\nAnd test with the iPad 7.1 and then let me know the status, Still can't find a solution for this issue, So i need your help here,\r\nI posted my code below for your reference\r\n// ########## CODE STARTS HERE ########\r\nvar self = Titanium.UI.createWindow(\r\n{ top : 0, navBarHidden : true, backgroundColor : \"#FFF\", exitOnClose : false\t}\r\n);\r\n// ############ Bottom VIEW WHICH SHOWS Controller Options ################### //\r\nvar CustomControllerView = Titanium.UI.createView(\r\n{ width : Ti.UI.FILL,height : 140,backgroundColor : \"#666666\",bottom : 0,layout : \"horizontal\" }\r\n);\r\n// ############ WHOLE PAGE WHICH SHOWS CAMERA ################### //\r\nvar overlayView = Titanium.UI.createView();\r\noverlayView.add(CustomControllerView);\r\nCustomControllerView.add(leftView);\r\nvar leftView = Titanium.UI.createLabel(\r\n{ text : Click for Gallery\", width : 80, height : 80, left : 40, top : 30, zIndex : 2 }\r\n); \r\nCustomControllerView.add(leftView);\r\n// ############ Function for Take Picture ################### //\r\nfunction takePictureViaCamera()\r\n{ Ti.Media.takePicture();\t}\r\nleftView.addEventListener('click', OpenPhoneGallery);\r\nfunction OpenPhoneGallery(){\r\nTi.Media.hideCamera(); // Hiding the camera which is showing in overlay\r\nTi.Media.openPhotoGallery({\r\nsuccess : function(ev)\r\n{ SharePageCallFunc(ev); }\r\n,\r\ncancel : function()\r\n{ alert(\"Gallery is not opened\"); }\r\n,\r\nerror : function(err){\r\nvar a = Titanium.UI.createAlertDialog(\r\n{ title : 'Gallery' }\r\n);\t\r\na.setMessage('Unexpected error: ' + err.code);\t\r\na.show();\r\n},\r\nshowControls : false,\r\nmediaTypes : Ti.Media.MEDIA_TYPE_PHOTO,\r\nautohide : true\r\n});\r\n}\r\n// ######### CAMERA OPEN FUNC ########## //\r\nfunction CameraOpenFunc() {\r\nTitanium.Media.showCamera({\r\nsaveToPhotoGallery : false,\r\nsuccess : function(ev)\r\n{ Ti.API.info(JSON.stringify(ev)); SharePageCallFunc(ev, true); }\r\n,\r\ncancel : function() {\r\n},\r\nerror : function(error) {\r\nvar a = Titanium.UI.createAlertDialog(\r\n{ title : 'Camera' }\r\n);\r\nif (error.code == Titanium.Media.NO_CAMERA)\r\n{ a.setMessage('Please run this test on device'); }\r\nelse\r\n{ a.setMessage('Unexpected error: ' + error.code); }\r\na.show();\r\n},\r\noverlay : overlayView,\r\ntransform : Ti.UI.create2DMatrix().scale(1),\r\nshowControls : false, // don't show system controls\r\nmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],\r\nautohide : false // tell the system not to auto-hide and we'll do it ourself, So we should handle \r\n// hide by Ti.Media.hideCamera();\r\n});\r\n}\r\nfunction SharePageCallFunc(eve,hidecam){\r\nif (hidecam)\r\n{ Ti.Media.hideCamera(); }\r\nvar shareImageView = Ti.UI.createImageView(\r\n{ width : Ti.UI.SIZE, height: Ti.UI.SIZE, image : eve.media,\tleft : 0, top : 0, bottom : 0, autorotate:true, top : 100 }\r\n);\t\r\nself.add(shareImageView);\r\n}\r\nself.addEventListener(\"open\", CameraOpenFunc);\r\nself.open();", "updateAuthor": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2015-04-22T07:02:41.000+0000", "updated": "2015-04-22T07:02:41.000+0000" }, { "id": "350349", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "The old one has been re-open. Close this one as duplicate. ", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2015-04-22T07:04:02.000+0000", "updated": "2015-04-22T07:04:02.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }