Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

What does startScanning() do and how to implement it? #286

Open
SebastianJurupe opened this issue Aug 26, 2023 · 1 comment
Open

What does startScanning() do and how to implement it? #286

SebastianJurupe opened this issue Aug 26, 2023 · 1 comment

Comments

@SebastianJurupe
Copy link

I'm having a problem when implementing startScaning(), it's supposed to run the sccanner several times right?

@noberumotto
Copy link

const startScan = async () => {
  // Check camera permission
  // This is just a simple example, check out the better checks below
  await BarcodeScanner.checkPermission({ force: true });

  // make background of WebView transparent
  // note: if you are using ionic this might not be enough, check below
  // BarcodeScanner.hideBackground();

  await BarcodeScanner.startScanning(undefined, async (result) => {
    if (result.hasContent) {
      console.log(result.content); // log the raw scanned content
    }
    await BarcodeScanner.resumeScanning();
  });
};

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants