{ "id": "142194", "key": "AC-1510", "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-09-29T01:44:10.000+0000", "created": "2015-01-01T00:02:00.000+0000", "labels": [ "andoid", "camera" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:57.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": [], "description": "Working through a book example that looks something like this:\r\n\r\nvar photoSource = Titanium.Media.getIsCameraSupported() ?\r\n Titanium.Media.showCamera : Titanium.Media.openPhotoGallery;\r\n\r\nphotoSource({object...});\r\n\r\nThis code execute find on iOS devices but throws an illegal invocation exception on android devices.\r\n\r\nThis was my workaround:\r\nphotoSource.call(Titanium.Media, { ...\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: Illegal invocation aliasing Titanium.Media.showCamera", "creator": { "name": "nsardo", "key": "nsardo", "displayName": "Nick Sardo", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nsardo", "key": "nsardo", "displayName": "Nick Sardo", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "alloy 1.5.1\r\ntitanium 3.4 sdk", "comment": { "comments": [ { "id": "337775", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi,\r\n\r\nNot quite follow you case, please provide a simple test case to reproduce your problem. Thanks\r\n\r\nRegards,\r\nShuo", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2015-01-05T04:24:36.000+0000", "updated": "2015-01-05T04:24:36.000+0000" }, { "id": "337847", "author": { "name": "nsardo", "key": "nsardo", "displayName": "Nick Sardo", "active": true, "timeZone": "America/Los_Angeles" }, "body": "// feed.js controller\r\n\r\nvar args = arguments[0] || {};\r\n\r\nOS_IOS && $.cameraButton.addEventListener(\"click\", function(_event){\r\n\t$.cameraButtonClicked(_event);\r\n});\r\n\r\n$.cameraButtonClicked = function(_event) {\r\n\t\r\n\tvar photoSource = Titanium.Media.getIsCameraSupported() ?\r\n\t\tTitanium.Media.showCamera : Titanium.Media.openPhotoGallery;\r\n \r\n // this call will throw an illegal invocation error on Android \r\n\tphotoSource({\r\n\t\tsuccess: function(event){\r\n\t\t\tprocessImage(event.media, function(photoResp){\r\n\t\t\t\t\r\n\t\t\t\t// create row\r\n\t\t\t\tvar row = Alloy.createController('feedRow', photoResp);\r\n\t\t\t\t\r\n\t\t\t\t// add the controller view, which is a row to the table\r\n\t\t\t\tif ($.feedTable.getData().length === 0) {\r\n\t\t\t\t\t$.feedTable.setData([]);\r\n\t\t\t\t\t$.feedTable.appendRow(row.getView(), true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$.feedTable.insertRowBefore(0, row.getView(), true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t},\r\n\t\tcancel: function() {\r\n\t\t // called when user cancels taking a picture\r\n\t\t},\r\n\t\terror: function(error) {\r\n\t\t if(error.code == Ti.Media.NO_CAMERA)\r\n\t\t \talert('Please run this test on a device');\r\n\t\t else\r\n\t\t \talert('Unexpected error: ' + error.code);\r\n\t\t},\r\n\t\tsaveToPhotoGallery:false,\r\n\t\tallowEditing: true,\r\n\t\t// only alow for photos no videa\r\n\t\tmediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO]\r\n\t});\r\n};\r\n\r\nfunction processImage(_mediaObject, _callback) {\r\n\t// since there is no cloud integration we will fake it\r\n\tvar photoObject = {\r\n\t\timage: _mediaObject,\r\n\t\ttitle: \"Sample Photo \" + new Date()\r\n\t};\r\n\t\r\n\t// return obj to caller \r\n\t \r\n\t_callback(photoObject);\r\n};\r\n", "updateAuthor": { "name": "nsardo", "key": "nsardo", "displayName": "Nick Sardo", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-01-05T18:21:24.000+0000", "updated": "2015-01-05T18:21:24.000+0000" }, { "id": "362150", "author": { "name": "hmrida", "key": "hmrida", "displayName": "Harish Mridha", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hi ,\r\nI tested the issue you reported.It looks like the feature \"*Titanium.Media.showCamera* and *Titanium.Media.getIsCameraSupported* \" in Android is working fine for me .I can't reproduce it . \r\nHowever, feel free to reopen with additional information such as proper description , test case and steps to reproduce a if you notice otherwise.I also recommend you upgrade SDK and Alloy to the latest build and let us know if you get the error again.\r\nI tested this using the studio build: 4.1.1.201507141126 , TiSDK 4.1.0 GA and alloy -v 1.6.2\r\n\r\nThanks \r\n", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-09-03T06:47:51.000+0000", "updated": "2015-09-29T01:44:27.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }