From 782cedf03c0ec672057eaee4948c407076edf191 Mon Sep 17 00:00:00 2001 From: danieloprado Date: Sat, 24 Feb 2024 11:44:27 +0000 Subject: [PATCH 1/3] fix(ios): export like docs --- ios/VisionCameraOcr.m | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/ios/VisionCameraOcr.m b/ios/VisionCameraOcr.m index b29cb0d..e7189a4 100644 --- a/ios/VisionCameraOcr.m +++ b/ios/VisionCameraOcr.m @@ -4,17 +4,4 @@ #import "VisionCameraOcr-Swift.h" -@interface OCRFrameProcessorPlugin (FrameProcessorPluginLoader) -@end - -@implementation OCRFrameProcessorPlugin (FrameProcessorPluginLoader) - -+ (void)load -{ - [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"scanOCR" - withInitializer:^FrameProcessorPlugin* (VisionCameraProxyHolder* proxy, NSDictionary* options) { - return [[OCRFrameProcessorPlugin alloc] initWithProxy:proxy withOptions:options]; - }]; -} - -@end +VISION_EXPORT_SWIFT_FRAME_PROCESSOR(OCRFrameProcessorPlugin, scanOCR) \ No newline at end of file From 1c9a78f35563908d0b77bcba3d51f52d388debaa Mon Sep 17 00:00:00 2001 From: danieloprado Date: Sat, 24 Feb 2024 15:10:18 +0000 Subject: [PATCH 2/3] fix(android): build with 3.9 --- .../main/java/com/visioncameraocr/VisionCameraOcrPackage.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt b/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt index 00cc15e..c6c7a54 100644 --- a/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt +++ b/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt @@ -12,8 +12,8 @@ override fun createNativeModules(reactContext: ReactApplicationContext): List { if(!OCRFrameProcessorPlugin.isRegistered){ OCRFrameProcessorPlugin.isRegistered = true - FrameProcessorPluginRegistry.addFrameProcessorPlugin("scanOCR"){ - OCRFrameProcessorPlugin(it) + FrameProcessorPluginRegistry.addFrameProcessorPlugin("scanOCR"){ _ , options -> + OCRFrameProcessorPlugin(options) } } return emptyList() From 210900cfa6e777416d8c55ab79abda18ba47bcdd Mon Sep 17 00:00:00 2001 From: danieloprado Date: Sat, 24 Feb 2024 15:16:54 +0000 Subject: [PATCH 3/3] fix(android): build with 3.9 --- .../main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt b/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt index d87251b..a5bda18 100644 --- a/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt +++ b/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt @@ -17,7 +17,7 @@ import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin import com.mrousavy.camera.types.Orientation - class OCRFrameProcessorPlugin(options: MutableMap?) : FrameProcessorPlugin(options) { + class OCRFrameProcessorPlugin(options: MutableMap?) : FrameProcessorPlugin() { private fun getBlockArray(blocks: MutableList): List> { val blockArray = mutableListOf>()