@regulaforensics/react-native-document-reader-api 6.7.3 → 6.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  #import <Foundation/Foundation.h>
2
- #import "RegulaConfig.h"
2
+ #import "RGLWRegulaConfig.h"
3
3
 
4
- @implementation RegulaConfig
4
+ @implementation RGLWRegulaConfig
5
5
  +(void)setConfig:(NSDictionary*)options :(RGLDocReader*)reader {
6
6
  if([options valueForKey:@"customization"] != nil)
7
7
  [self setCustomization: [options valueForKey:@"customization"]: reader.customization];
@@ -578,6 +578,8 @@
578
578
  customization.toolbarSize = [[options valueForKey:@"toolbarSize"] floatValue];
579
579
  if([options valueForKey:@"statusBackgroundColor"] != nil)
580
580
  customization.statusBackgroundColor = [self getUIColorObjectFromHexString:[options valueForKey:@"statusBackgroundColor"] alpha:1];
581
+ if([options valueForKey:@"cameraPreviewBackgroundColor"] != nil)
582
+ customization.cameraPreviewBackgroundColor = [self getUIColorObjectFromHexString:[options valueForKey:@"cameraPreviewBackgroundColor"] alpha:1];
581
583
  if([options valueForKey:@"hologramAnimationImageContentMode"] != nil)
582
584
  customization.hologramAnimationImageContentMode = [self UIViewContentModeWithNSInteger:[[options valueForKey:@"hologramAnimationImageContentMode"] integerValue]];
583
585
  if([options valueForKey:@"hologramAnimationPositionMultiplier"] != nil)
@@ -625,7 +627,9 @@
625
627
  if([options valueForKey:@"cameraPosition"] != nil)
626
628
  functionality.cameraPosition = [self AVCaptureDevicePositionWithNSInteger:[[options valueForKey:@"cameraPosition"] integerValue]];
627
629
  if([options valueForKey:@"btDeviceName"] != nil)
630
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
628
631
  functionality.btDeviceName = [options valueForKey:@"btDeviceName"];
632
+ #pragma clang diagnostic pop
629
633
  if([options valueForKey:@"useAuthenticator"] != nil)
630
634
  functionality.useAuthenticator = [[options valueForKey:@"useAuthenticator"] boolValue];
631
635
  if([options valueForKey:@"showCaptureButtonDelayFromDetect"] != nil)
@@ -644,6 +648,8 @@
644
648
  functionality.recordScanningProcess = [[options valueForKey:@"recordScanningProcess"] boolValue];
645
649
  if([options valueForKey:@"manualMultipageMode"] != nil)
646
650
  functionality.manualMultipageMode = [[options valueForKey:@"manualMultipageMode"] boolValue];
651
+ if([options valueForKey:@"videoOutputSettings"] != nil)
652
+ functionality.videoOutputSettings = [options valueForKey:@"videoOutputSettings"];
647
653
  if([options valueForKey:@"onlineProcessingConfiguration"] != nil)
648
654
  functionality.onlineProcessingConfig = [self RGLOnlineProcessingConfigFromJSON:[options valueForKey:@"onlineProcessingConfiguration"]];;
649
655
  }
@@ -724,7 +730,7 @@
724
730
  if([options valueForKey:@"updateOCRValidityByGlare"] != nil)
725
731
  processParams.updateOCRValidityByGlare = [options valueForKey:@"updateOCRValidityByGlare"];
726
732
  if([options valueForKey:@"imageQA"] != nil)
727
- processParams.imageQA = [RegulaConfig ImageQAFromJson:[options valueForKey:@"imageQA"]];
733
+ processParams.imageQA = [RGLWRegulaConfig ImageQAFromJson:[options valueForKey:@"imageQA"]];
728
734
  if([options valueForKey:@"forceDocFormat"] != nil)
729
735
  processParams.forceDocFormat = [options valueForKey:@"forceDocFormat"];
730
736
  if([options valueForKey:@"noGraphics"] != nil)
@@ -761,6 +767,8 @@
761
767
  processParams.documentGroupFilter = [options mutableArrayValueForKey:@"documentGroupFilter"];
762
768
  if([options valueForKey:@"convertCase"] != nil)
763
769
  processParams.convertCase = [options valueForKey:@"convertCase"];
770
+ if([options valueForKey:@"rfidParams"] != nil)
771
+ processParams.rfidParams = [self RGLRFIDParamsFromJSON:[options valueForKey:@"rfidParams"]];
764
772
  }
765
773
 
766
774
  +(NSMutableDictionary *)getCustomization:(RGLCustomization*)customization {
@@ -817,6 +825,8 @@
817
825
  result[@"statusTextColor"] = [self hexStringFromUIColor:customization.statusTextColor];
818
826
  if(customization.resultStatusBackgroundColor != nil)
819
827
  result[@"resultStatusBackgroundColor"] = [self hexStringFromUIColor:customization.resultStatusBackgroundColor];
828
+ if(customization.cameraPreviewBackgroundColor != nil)
829
+ result[@"cameraPreviewBackgroundColor"] = [self hexStringFromUIColor:customization.cameraPreviewBackgroundColor];
820
830
  if(customization.cameraFrameDefaultColor != nil)
821
831
  result[@"cameraFrameDefaultColor"] = [self hexStringFromUIColor:customization.cameraFrameDefaultColor];
822
832
  if(customization.cameraFrameActiveColor != nil)
@@ -846,7 +856,9 @@
846
856
  result[@"videoCaptureMotionControl"] = [NSNumber numberWithBool:functionality.videoCaptureMotionControl];
847
857
  result[@"orientation"] = [NSNumber numberWithInteger:[self NSIntegerWithUIInterfaceOrientationMask:functionality.orientation]];
848
858
  result[@"cameraPosition"] = [NSNumber numberWithInteger:[self NSIntegerWithAVCaptureDevicePosition:functionality.cameraPosition]];
859
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
849
860
  result[@"btDeviceName"] = functionality.btDeviceName;
861
+ #pragma clang diagnostic pop
850
862
  result[@"useAuthenticator"] = [NSNumber numberWithBool:functionality.isUseAuthenticator];
851
863
  result[@"showCaptureButtonDelayFromDetect"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromDetect];
852
864
  result[@"showCaptureButtonDelayFromStart"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromStart];
@@ -856,6 +868,7 @@
856
868
  result[@"zoomFactor"] = [NSNumber numberWithBool:functionality.zoomFactor];
857
869
  result[@"recordScanningProcess"] = [NSNumber numberWithBool:functionality.recordScanningProcess];
858
870
  result[@"manualMultipageMode"] = [NSNumber numberWithBool:functionality.manualMultipageMode];
871
+ result[@"videoOutputSettings"] = functionality.videoOutputSettings;
859
872
 
860
873
  return result;
861
874
  }
@@ -901,7 +914,7 @@
901
914
  result[@"matchTextFieldMask"] = processParams.matchTextFieldMask;
902
915
  result[@"fastDocDetect"] = processParams.fastDocDetect;
903
916
  result[@"updateOCRValidityByGlare"] = processParams.updateOCRValidityByGlare;
904
- result[@"imageQA"] = [RegulaConfig ImageQAToJson:processParams.imageQA];
917
+ result[@"imageQA"] = [RGLWRegulaConfig ImageQAToJson:processParams.imageQA];
905
918
  result[@"forceDocFormat"] = processParams.forceDocFormat;
906
919
  result[@"noGraphics"] = processParams.noGraphics;
907
920
  result[@"documentAreaMin"] = processParams.documentAreaMin;
@@ -1029,4 +1042,13 @@
1029
1042
  rfidScenario.defaultReadingBufferSize = [[options valueForKey:@"defaultReadingBufferSize"] intValue];
1030
1043
  }
1031
1044
 
1045
+ +(RGLRFIDParams*)RGLRFIDParamsFromJSON:(NSDictionary*)input {
1046
+ RGLRFIDParams* result = [RGLRFIDParams new];
1047
+
1048
+ if([input valueForKey:@"paIgnoreNotificationCodes"] != nil)
1049
+ result.paIgnoreNotificationCodes = [input valueForKey:@"paIgnoreNotificationCodes"];
1050
+
1051
+ return result;
1052
+ }
1053
+
1032
1054
  @end
@@ -2,13 +2,19 @@
2
2
  #import <React/RCTEventEmitter.h>
3
3
  #import <DocumentReader/DocumentReader.h>
4
4
  #import "RGLWJSONConstructor.h"
5
- #import "RegulaConfig.h"
5
+ #import "RGLWRegulaConfig.h"
6
6
 
7
- @interface RNRegulaDocumentReader : RCTEventEmitter <RCTBridgeModule, RGLRecordScanningProcessDelegate, RGLDocReaderRFIDDelegate>
7
+ typedef void (^RGLWCallback)(NSString* _Nullable response);
8
+ typedef void (^RGLWRFIDSignatureCallback)(NSData * _Nonnull signature);
9
+
10
+ @interface RNRegulaDocumentReader : RCTEventEmitter <RCTBridgeModule,
11
+ RGLRecordScanningProcessDelegate,
12
+ RGLDocReaderRFIDDelegate,
13
+ RGLCustomizationActionDelegate>
8
14
 
9
15
  @property (class) NSNumber* _Nullable databasePercentageDownloaded;
10
16
 
11
17
  @end
12
18
 
13
- @interface RFIDDelegateNoPA : NSObject<RGLDocReaderRFIDDelegate>
19
+ @interface RGLWRFIDDelegateNoPA : NSObject<RGLDocReaderRFIDDelegate>
14
20
  @end