Closed diepoe closed 1 year ago
@diepoe you are currently not requesting the permission ;)
BarcodeScanner.checkPermission({ force: true });
is missing in your requestCameraPermission()
function.
When adding this, it works on my Pixel 6 :) I guess iOS is requesting the permission itself once access to the camera API is requested, but on Android you have to do this manually...
function requestCameraPermission() {
BarcodeScanner.prepare();
BarcodeScanner.checkPermission({ force: true });
}
Ah, there is one more issue, you should request permission before you call prepare
and await the response, otherwise, the prepare
call will be kinda useless...
Works now, thank you very much! 🙏
Before describing my problem, I just wanna thank you for building such a nice product! It's working very performant on iOS and purely timesaving for my current school project! Thank you for your work!
Describe the bug Although the plugin is working fine on the iOS build of my app, the android version of my wouldn't show any sign of the plugin. This starts with the fact, that the app isn't asking the user to grant camera access, which results in a black screen at the qr code scanning view (I'm implementing this whole thing in Svelte btw).
To Reproduce Repository with the code: https://github.com/diepoe/heg-game
Steps to reproduce the behavior:
In the build app on android:
Expected behavior At step two, the android app should ask the user for granting camera access, on step 4 a proper qr code scan with the device camera should start
Screenshots
Version ^3.0.1
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context It's working fine on iOS, so I should be missing something on the android implementation I guess (although I already configured AndroidManifest.xml like documented)...
Thank you for any answer in advance :-)