You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a few difficulties to make this plugin work (with angular). The last one was that I didn't think about explicitly asking camera permission to the user. I guess this should (at least) be mentioned in the README page.
"@angular/…": "~15.2.0",
"@nativescript/angular": "^15.0.0",
"@nativescript/camera": "~5.0.15", # I used this to require camera permissions
"@nativescript/core": "~8.5.0",
"@nativescript/mlkit-barcode-scanning": "~2.0.0",
"@nativescript/mlkit-core": "~2.0.0",
I tried to create a fresh NativeScript app, with ns create test --ng and the mlkit packages above.
And then I just had a black screen. But it worked from ns-preview. So I realized that ns-preview actually ask for camera permission, and so it worked after adding @nativescript/camera to my package.json and making something like:
Hey @boutier yes I should add that to the readme, this is how I did it in the demo. Another thing I can do is add a static method to request permission
Hi, thx @boutier for the code, it helps me a lot... it works till android 12. But 13 is not using WRITE_EXTERNAL_STORAGE permission anymore, so that permission is never set to true... and so scanner is never visible. Any help or suggestions on that? Pretty please :) I feel like I am the only one using this plugin. Thank You!
I had a few difficulties to make this plugin work (with angular). The last one was that I didn't think about explicitly asking camera permission to the user. I guess this should (at least) be mentioned in the README page.
I tried to create a fresh NativeScript app, with
ns create test --ng
and the mlkit packages above.And then I just had a black screen. But it worked from ns-preview. So I realized that ns-preview actually ask for camera permission, and so it worked after adding
@nativescript/camera
to my package.json and making something like:Notes:
(onLoaded)="$event.object.requestCameraPermission()
toMLKitView
.@ViewChild
Clearly, it would be great to add some documentation here https://github.com/NativeScript/mlkit/blob/main/packages/mlkit-core/README.md
I didn't propose a patch request because it may not be related to Angular only… but the angular section could be:
A last thing: thanks a lot for this plugin!
The text was updated successfully, but these errors were encountered: