Closed Z28ILOPE closed 2 years ago
You need to request permission to use the camera , I will add a note on this in the docs.
@triniwiz, thanks for your help!!
I've review my code and I've seen that i had already a function with this request:
onMLKitViewLoaded(args: any) {
const barcoScanner = args.object as MLKitView;
barcoScanner.requestCameraPermission();
}
I use nativescript-vue
You imported/registered the vue module ?
Yes, in main.ts
import MLKit from "@nativescript/mlkit-core/vue";
Vue.use(MLKit);
I've resolved the issue. We need to call to requestCameraPermission()
from the mounted()
lifecycle hook:
import { MLKitView } from "@nativescript/mlkit-core"
mounted() {
this.initMLKit()
}
initMLKit() {
const barcode = new MLKitView();
barcode.requestCameraPermission();
}
Issue Description When I run the app , it doesn't load the mlkit component and gives me a white screen
Package.json
app.gradle
HTML