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>() 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() diff --git a/ios/VisionCameraOcr.m b/ios/VisionCameraOcr.m index d922d2a..e7189a4 100644 --- a/ios/VisionCameraOcr.m +++ b/ios/VisionCameraOcr.m @@ -4,16 +4,4 @@ #import "VisionCameraOcr-Swift.h" -@interface OCRFrameProcessorPlugin (FrameProcessorPluginLoader) -@end - -@implementation OCRFrameProcessorPlugin (FrameProcessorPluginLoader) - -+ (void)load -{ - [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"scanOCR" withInitializer:^FrameProcessorPlugin * _Nonnull(NSDictionary * _Nullable options) { - return [[OCRFrameProcessorPlugin alloc] initWithOptions:options]; - }]; -} - -@end +VISION_EXPORT_SWIFT_FRAME_PROCESSOR(OCRFrameProcessorPlugin, scanOCR) \ No newline at end of file