Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants