Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

If the current application does not have permission to access the camera ,android 5.1 always success callback #517

Open
jyz1508 opened this issue Aug 1, 2017 · 1 comment

Comments

@jyz1508
Copy link

jyz1508 commented Aug 1, 2017

Expected Behaviour

If the current application does not have permission to access the camera , the error callback should be executed

Actual Behaviour

The camera will be turned on, indicating a problem with the camera , the success callback is always executed with data result as:
Object {cancelled: true, text: "", format: ""}

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android 5.1

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

MI meizu

Cordova CLI version and cordova platform version

cordova 7.0.1

Plugin version

6.0.8

Sample Code that illustrates the problem

  window.cordova.plugins.barcodeScanner.scan((result)=>{
      if(!result.cancelled){
        callback(result.text);
      }else{
        alert(JSON.stringify(result))
      }
    },(error)=>{
       alert("Scanning failed: " + error);
    },
    {
        ...
    }
  );

Object {cancelled: true, text: "", format: ""}

But in android 7.0 , the error callback will be executed , the error data is "Illegal access"

@amirhosein93
Copy link

amirhosein93 commented Jun 15, 2019

can not work by cordova-android-firebase-gradle-release

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants