id1945 / ngx-scanner-qrcode

This library is built to provide a solution scanner QR code. This library takes in raw images and will locate, extract and parse any QR code found within.
https://id1945.github.io/ngx-scanner-qrcode
GNU Lesser General Public License v2.1
54 stars 28 forks source link

Multiple scan issue #32

Closed eTolgaKaradogan closed 1 year ago

eTolgaKaradogan commented 1 year ago

Hi,

Basically I want to scan only one QR Code and close the dialog window. When I scanned the QR Code its scans multiple times, may be 7-10 times.

I just want to scan one time every time dialog window opens. Can u help me?

Thanks in advance.

id1945 commented 1 year ago

@eTolgaKaradogan I have updated the new version on this issue check it now.

eTolgaKaradogan commented 1 year ago

@eTolgaKaradogan I have updated the new version on this issue check it now.

Hi,

I checked the new version but can not find the solution.

Basically, there will be notification when QR Code is scanned. But when I scan the QR Code there are 7-8 notifies. Also, my code is like that:

const data = e[0].value;

So what I am trying to do is with just one data.

id1945 commented 1 year ago

@eTolgaKaradogan

  public onEvent(e: ScannerQRCodeResult[], action?: any): void {
    e && action && action.pause();  // you can using pause() or stop()
    console.log(e);
  }
const data = e[0].value;
// The scanner detects all the QRCODE on the screen they see and returns the array of data
// You take the first element is absolutely correct.