diff --git a/android/src/main/java/com/visioncameraopencvqrcodeparser/VisionCameraOpencvQrcodeProcessorPlugin.java b/android/src/main/java/com/visioncameraopencvqrcodeparser/VisionCameraOpencvQrcodeProcessorPlugin.java index 19a1047..ae91534 100644 --- a/android/src/main/java/com/visioncameraopencvqrcodeparser/VisionCameraOpencvQrcodeProcessorPlugin.java +++ b/android/src/main/java/com/visioncameraopencvqrcodeparser/VisionCameraOpencvQrcodeProcessorPlugin.java @@ -36,14 +36,14 @@ public Object callback(@NonNull ImageProxy imageProxy, @NonNull Object[] params) WritableNativeArray array = new WritableNativeArray(); Image image = imageProxy.getImage(); if (image == null) { - map.putArray("barcode", array); + map.putArray("barcodes", array); return map; } List results = WeChatQRCodeDetector.detectAndDecode(toBitmap(image)); for (String item : results) { array.pushString(item); } - map.putArray("barcode", array); + map.putArray("barcodes", array); return map; } diff --git a/src/index.tsx b/src/index.tsx index 0801318..32051a0 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2,10 +2,9 @@ import type { Frame } from "react-native-vision-camera"; declare let _WORKLET: true | undefined; -export function qrcodeProcessorPlugin(frame: Frame): string[] { +export function qrcodeProcessorPlugin(frame: Frame): { barcodes: string[] } { "worklet"; if (!_WORKLET) throw new Error("qrcodeProcessorPlugin must be called from a frame processor!"); - console.log("__qrcode_processor_plugin enter") // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error because this function is dynamically injected by VisionCamera return __qrcode_processor_plugin(frame);