{ "id": "131118", "key": "TIMOB-17470", "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": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2016-09-28T17:21:20.000+0000", "created": "2014-06-01T06:57:07.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "TCSupport" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" }, { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-03-29T17:25:02.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": "h4. Problem Description\r\nThe getFlashMode never work, even after set it. \r\n\r\nh4. Test Case\r\n{code:javascript}\r\nvar win1 = Titanium.UI.createWindow({\r\n title: 'Tab 1',\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar camera = Ti.UI.createButton({\r\n title: 'Show Camera'\r\n});\r\n\r\ncamera.addEventListener('click', function() {\r\n if (Ti.Media.isCameraSupported) {\r\n Ti.Media.setCameraFlashMode(Ti.Media.CAMERA_FLASH_ON);\r\n // Ti.Media.setCameraFlashMode(1);\r\n Ti.API.info(Ti.Media.getCameraFlashMode()); //Note: If we setCameraFlashMode(1) or Ti.Media.CAMERA_FLASH_ON or nay of it it always return 0.\r\n Titanium.Media.showCamera({\r\n success: function(event) {\r\n Ti.API.debug('Our type was: ' + event.mediaType);\r\n if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {\r\n var imageView = Ti.UI.createImageView({\r\n width: win.width,\r\n height: win.height,\r\n image: event.media\r\n });\r\n win1.add(imageView);\r\n } else {\r\n alert(\"got the wrong type back =\" + event.mediaType);\r\n }\r\n },\r\n cancel: function() {\r\n // called when user cancels taking a picture\r\n },\r\n error: function(error) {\r\n // called when there's an error\r\n var a = Titanium.UI.createAlertDialog({\r\n title: 'Camera'\r\n });\r\n if (error.code == Titanium.Media.NO_CAMERA) {\r\n a.setMessage('Please run this test on device');\r\n } else {\r\n a.setMessage('Unexpected error: ' + error.code);\r\n }\r\n a.show();\r\n },\r\n saveToPhotoGallery: true,\r\n allowEditing: true,\r\n mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO, Ti.Media.MEDIA_TYPE_PHOTO],\r\n showControls: true // always use to get the basic facility about camera.\r\n //overlay:overlayview // do not use overlay to when you want to use the switching facility\r\n });\r\n }\r\n});\r\n\r\nwin1.add(camera);\r\nwin1.open();\r\n{code}\r\n\r\nh4. Steps To Reproduce\r\n \r\n- Create a new project\r\n- Update app.js file with sample code\r\n- And run on iOS device 7.1\r\n- Camera Flash Mode always set to Auto and returns 0.\r\n \r\nh4. Expected Result\r\n It’s not working as expected.\r\n", "attachment": [], "flagged": false, "summary": "IOS: setCameraFlashMode(); \tgetCameraFlashMode(); do not work", "creator": { "name": "cpunerd", "key": "cpunerd", "displayName": "Ken", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "cpunerd", "key": "cpunerd", "displayName": "Ken", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac OS \r\nTi CLI 5.5.0.GA\r\nTitanium SDK: 5.5.0.GA\r\niOS 10", "comment": { "comments": [ { "id": "317520", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Thanks for your report! The Platform team will set the priority. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-08-07T16:47:05.000+0000", "updated": "2014-08-07T16:47:05.000+0000" }, { "id": "396095", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "After a quick look, the implementation looks correct. [~sdarda] or [~mrahman] Can you run a quick test on the device to verify this with 5.5.0.GA?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-14T08:24:46.000+0000", "updated": "2016-09-14T08:27:40.000+0000" }, { "id": "397030", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "[~hansknoechel],\r\n\r\nI tested the sample code in descirption on iOS 10 with 5.5.0.GA. \r\n\r\nThe setCameraFlashMode() did not work as expected. (always set 0 for flash mode)\r\n\r\n", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2016-09-23T11:09:06.000+0000", "updated": "2016-09-23T11:09:06.000+0000" }, { "id": "397073", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The reason why it returns 0 is that the internal setter only sets the value if there already is a picker (aka camera) that it can be applied. So I actually think it never worked before. I will schedule further investigation for 6.1.0.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-23T18:58:01.000+0000", "updated": "2016-09-23T18:58:01.000+0000" }, { "id": "397143", "author": { "name": "mmeyer", "key": "mmeyer", "displayName": "mmeyer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It works in iOS 9, but stopped working in iOS10.", "updateAuthor": { "name": "mmeyer", "key": "mmeyer", "displayName": "mmeyer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-24T07:06:55.000+0000", "updated": "2016-09-24T07:06:55.000+0000" }, { "id": "397148", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Let's get this straight:\r\n- The {{cameraFlashMode}} property is meant to be set and gotten through custom UI that controls it\r\n- If you set or get it before opening the camera, no value is applied (since there is no camera to apply it to) and the getter will always return the default value (which is automatic / 0)\r\n- In order to get and get it properly, you need to have a custom UI that triggers the flash-mode, since the native controls set it using the internal methods that do not effect the state of this property\r\n\r\nSo the only thing I'm wondering is how this could possibly worked on iOS 9 but not 10. The provided demo-code is a) invalid because of setting and getting the flash-mode before opening the camera and b) cannot trigger the flash-mode, since no custom UI ({{overlay}}) is used (see TIDOC-886 for more info).\r\n\r\nAnd finally, if it all worked in iOS 9, this is (another) iOS 10 issue: https://forums.developer.apple.com/thread/61467", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-24T12:40:57.000+0000", "updated": "2016-09-24T13:08:25.000+0000" }, { "id": "399135", "author": { "name": "mmeyer", "key": "mmeyer", "displayName": "mmeyer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is an issue on samsung S6 using android 6.0.x. Again if we use OS camera the Flash works. if we use camera overlay flash does not work.", "updateAuthor": { "name": "mmeyer", "key": "mmeyer", "displayName": "mmeyer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-17T18:53:18.000+0000", "updated": "2016-10-17T18:54:27.000+0000" }, { "id": "416202", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as \"Not Our Bug\".", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-29T17:25:02.000+0000", "updated": "2017-03-29T17:25:02.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }