react-native-qrcode-scanner
react-native-qrcode-scanner copied to clipboard
How can I open scan results in WebView?
I am a beginner developer.
I already have a web app and implement only the necessary features in a reactive native. I am using the package. The result of the QR Code in the package is opened in a new browser. I want this to be opened in the webview. Is there a good way? Please help me. Thank you.
This might be useful to look at: https://facebook.github.io/react-native/docs/webview
I haven't tried doing the above, but if you do, feel free to contribute/add an example under https://github.com/moaazsidat/react-native-qrcode-scanner/tree/master/examples
Try to use Linking:
import { Linking } from 'react-native'
...
onBarCodeRead = (scanResult) => {
if (scanResult.data != null) {
Linking
.openURL(scanResult.data)
.catch(err => console.error('An error occured', err));
this.scanner.reactivate();
}
return;
}
This is not a library issue. You must read react-native documentation.
https://facebook.github.io/react-native/docs/linking