{"action":"created","issue":{"url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/167","repository_url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview","labels_url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/167/comments","events_url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/167/events","html_url":"https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/167","id":206114379,"number":167,"title":"Flash on iOS?","user":{"login":"CharlieCamp98","id":22163606,"avatar_url":"https://avatars0.githubusercontent.com/u/22163606?v=3","gravatar_id":"","url":"https://api.github.com/users/CharlieCamp98","html_url":"https://github.com/CharlieCamp98","followers_url":"https://api.github.com/users/CharlieCamp98/followers","following_url":"https://api.github.com/users/CharlieCamp98/following{/other_user}","gists_url":"https://api.github.com/users/CharlieCamp98/gists{/gist_id}","starred_url":"https://api.github.com/users/CharlieCamp98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CharlieCamp98/subscriptions","organizations_url":"https://api.github.com/users/CharlieCamp98/orgs","repos_url":"https://api.github.com/users/CharlieCamp98/repos","events_url":"https://api.github.com/users/CharlieCamp98/events{/privacy}","received_events_url":"https://api.github.com/users/CharlieCamp98/received_events","type":"User","site_admin":false},"labels":[{"id":161062010,"url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/labels/help%20wanted","name":"help wanted","color":"159818","default":true},{"id":161062012,"url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2017-02-08T07:06:03Z","updated_at":"2017-03-07T17:17:28Z","closed_at":null,"body":"cordova.plugins.camerapreview.setFlashMode() does not seem to work on iOS 10.2.\r\n\r\nHow can I go about resolving this? Flash is a must for my app."},"comment":{"url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/comments/284791974","html_url":"https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/167#issuecomment-284791974","issue_url":"https://api.github.com/repos/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues/167","id":284791974,"user":{"login":"jlongman","id":1051995,"avatar_url":"https://avatars2.githubusercontent.com/u/1051995?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongman","html_url":"https://github.com/jlongman","followers_url":"https://api.github.com/users/jlongman/followers","following_url":"https://api.github.com/users/jlongman/following{/other_user}","gists_url":"https://api.github.com/users/jlongman/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongman/subscriptions","organizations_url":"https://api.github.com/users/jlongman/orgs","repos_url":"https://api.github.com/users/jlongman/repos","events_url":"https://api.github.com/users/jlongman/events{/privacy}","received_events_url":"https://api.github.com/users/jlongman/received_events","type":"User","site_admin":false},"created_at":"2017-03-07T17:17:28Z","updated_at":"2017-03-07T17:17:28Z","body":"Looking at this - I'm seeing that the flash state is being set before the camera is changed to the back camera - and of course the front camera has no flash. This results in the flash being on, despite being set to off.\r\n\r\n\r\n\r\n```\r\n2017-03-07 12:12:04.044696 FD Snow[8065:1362537] setOnPictureTakenHandler\r\n2017-03-07 12:12:04.046899 FD Snow[8065:1362537] getSupportedPictureSizes\r\n2017-03-07 12:12:04.191446 FD Snow[8065:1362676] Starting session\r\n2017-03-07 12:12:04.216077 FD Snow[8065:1362537] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles\r\n2017-03-07 12:12:04.221042 FD Snow[8065:1362537] [MC] Reading from public effective user settings.\r\n2017-03-07 12:12:04.224350 FD Snow[8065:1362537] THREAD WARNING: ['CameraPreview'] took '176.384033' ms. Plugin should use a background thread.\r\n2017-03-07 12:12:04.225546 FD Snow[8065:1362537] Flash Mode\r\n2017-03-07 12:12:04.225646 FD Snow[8065:1362537] This device has no flash\r\n2017-03-07 12:12:04.225811 FD Snow[8065:1362537] hideCamera\r\n2017-03-07 12:12:04.227587 FD Snow[8065:1362676] defaultCamera: back\r\n```\r\n\r\nThe code which calls this is: \r\n\r\n```\r\n                CameraPreview.setOnPictureTakenHandler(function (base64PictureData) {\r\n                //..\r\n                });\r\n                CameraPreview.startCamera({\r\n                    x: 0,\r\n                    y: 40,\r\n                    width: 300,\r\n                    height: 200,\r\n                    camera: \"back\",\r\n                    tapPhoto: true,\r\n                    previewDrag: false,\r\n                    toBack: false,\r\n                    alpha: 1\r\n                });\r\n                CameraPreview.setFlashMode(\"off\");\r\n                CameraPreview.hide();\r\n```\r\n\r\nOne would think the `startCamera` call would set the camera to `back` before the flash was set, but clearly this doesn't happen.  I wonder if the flash state should be moved up and into `CameraPreview` and then applied each time the camera is switched, front to back."}}
{"actor":{"display_login":"jlongman"}}