react-native-qrcode-scanner icon indicating copy to clipboard operation
react-native-qrcode-scanner copied to clipboard

How can I open scan results in WebView?

Open Jay-flow opened this issue 6 years ago • 3 comments

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.

Jay-flow avatar Mar 11 '19 07:03 Jay-flow

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

moaazsidat avatar Apr 01 '19 13:04 moaazsidat

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;
}

superp avatar May 11 '19 21:05 superp

This is not a library issue. You must read react-native documentation.

https://facebook.github.io/react-native/docs/linking

jhoanborges avatar Nov 01 '19 17:11 jhoanborges