Replies: 1 comment 2 replies
-
I think just adding this line https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/android/src/main/AndroidManifest.xml#L5 in gen/android/... should be enough. At least according to my own messages i wrote a while back 🙃 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I love the idea of Tauri and I decided I'd use it for my first mobile/cross-platform app. I'm using React for the UI and found
react-webcam
for capturing the camera stream. It worked out of the box on desktop but when I try to run my app on Android, I got no video stream at all. It occurred to me that the app on my phone never asked for camera permissions. I searched the docs, Github, and Discord for how to request those from the user but couldn't find anything. I did see thebarcode-scanner
plugin and thought I'd try to figure out how it works there. It turns out that installingbarcode-scanner
plugin bytauri add barcode-scanner
already has the desired effect: my app asks for camera permissions as soon as it starts andreact-webcam
displays the video stream.I started going through
barcode-scanner
's code and it looks like there are separate Kotlin and SwiftrequestPermissions
functions. Am I missing a simpler way of requesting camera permissions or does it actually involve writing Kotlin and Swift code to support both Android and iOS? If that's the case, then I'm a bit surprised that there's no simplercamera
plugin without all the barcode functionality that thebarcode-scanner
could depend on. Is there a reason for this?Beta Was this translation helpful? Give feedback.
All reactions