What i need to do:
I have a webview and I need to access the camera to read qr code and barcode, however where the camera should appear is blank, when searching I saw that this is due to permissions that should be granted. How do I ask for permission and integrate the camera with my webview? If it is not possible, is it possible to pause the webview by clicking on an internal button, open the camera to read and after that open the webview by passing the parameters in the url? Help me please, I don’t know what to do.
My code:
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, SafeAreaView } from 'react-native';
import { WebView } from 'react-native-webview';
export default function App() {
return (
<SafeAreaView style={styles.container}>
<WebView source={{ uri: 'myurl' }}
style={{ marginTop: 20 }}
mediaPlaybackRequiresUserAction={true}
allowInlineMediaPlayback={false}
/>
<StatusBar style="auto" />
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1
}
});