How to call types BarCodeSize and BarCodePoint

I have no idea to implement it because i’m new in expo.

My code based on BarCodeScanner documentation

Hi @ramadita12

What are you trying to do with these values?

BarCodeSize is used in BarCodeBounds.
BarCodeBounds is the type of the bounds object that’s included as part of the BarCodeScannerResult. But as the documentation points out, this is not always available.
The onBarCodeScanned callback is called with a BarCodeScannerResult object.

So if you want to get the BarCodeSize you need to access it (if it’s available) in the onBarCodeScanned function.
It’s basically the same for BarCodePoint objects. These are either in a BarCodeBounds object (the bounding box origin point) or in the BarCodeScannerResult object (the corners).

EDIT: e.g. replace the onBarCodeScanned function from the example in the documentation with this:

  const handleBarCodeScanned = ({ type, data, bounds, cornerPoints }) => {
    setScanned(true);
    alert(JSON.stringify({ bounds, cornerPoints }, null, 2));
  };
1 Like

Hello @wodin
Thanks for replying my question, your answer help me to solve my problem. Btw i’m just trying to know what actually values in console log

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.