Titanium JIRA Archive
Appcelerator Community (AC)

[AC-475] Ti.Barcode not working on Android 6

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNeeds more info
Resolution Date2015-11-04T07:27:51.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator Modules
Labelsn/a
ReporterBe Rushton
AssigneeShak Hossain
Created2015-10-21T01:06:46.000+0000
Updated2015-12-02T08:53:06.000+0000

Description

On a device running Android 6, when the app tries to use the camera to scan the message "Sorry, the Android camera encountered a problem. You may need to restart the device." is shown and the camera cannot be used.

Comments

  1. Mostafizur Rahman 2015-11-03

    Hello, Can you please send us more info? We need a test case, steps to reproduce the issue and your working environment details. Thanks.
  2. Aminul Islam 2015-12-02

    Hi, Ti.Barcode use camera , camera ask for permission from the user in Android 6.0. So you need to add permission requesting for android 6 .
       if (Ti.Media.hasCameraPermissions()) {
       
       
       	window.open();
       
       
       } else { 
       
       
           Ti.Media.requestCameraPermissions(function(e) {
       
       
                    if (e.success === true) {
       
       
                   	 window.open();
       
       
                    } else {
       
       
                        alert("Access denied, error: " + e.error);
       
       
                    }
       
       
           });
       
       
       }
       
       
    Thanks

JSON Source