@regulaforensics/react-native-document-reader-api 6.8.1 → 6.9.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.
Files changed (75) hide show
  1. package/RNDocumentReaderApi.podspec +1 -1
  2. package/android/build.gradle +18 -1
  3. package/android/src/main/java/com/regula/documentreader/BluetoothUtil.kt +6 -6
  4. package/android/src/main/java/com/regula/documentreader/Helpers.java +117 -3
  5. package/android/src/main/java/com/regula/documentreader/JSONConstructor.java +182 -261
  6. package/android/src/main/java/com/regula/documentreader/RNRegulaDocumentReaderModule.java +142 -125
  7. package/android/src/main/java/com/regula/documentreader/RegulaConfig.java +114 -26
  8. package/example/.bundle/config +2 -0
  9. package/example/.eslintrc.js +1 -1
  10. package/example/.prettierrc.js +2 -2
  11. package/example/.watchmanconfig +1 -1
  12. package/example/App.tsx +358 -0
  13. package/example/Gemfile +6 -0
  14. package/example/Gemfile.lock +98 -0
  15. package/example/__tests__/{App-test.js → App.test.tsx} +3 -0
  16. package/example/android/app/build.gradle +77 -59
  17. package/example/android/app/src/debug/AndroidManifest.xml +1 -1
  18. package/example/android/app/src/debug/java/com/regula/dr/fullrfid/ReactNativeFlipper.java +7 -4
  19. package/example/android/app/src/main/AndroidManifest.xml +4 -9
  20. package/example/android/app/src/main/java/com/regula/dr/fullrfid/MainActivity.java +17 -0
  21. package/example/android/app/src/main/java/com/regula/dr/fullrfid/MainApplication.java +17 -36
  22. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  23. package/example/android/app/src/main/res/values/styles.xml +2 -2
  24. package/example/android/app/src/release/java/com/regula/dr/fullrfid/ReactNativeFlipper.java +20 -0
  25. package/example/android/build.gradle +7 -18
  26. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  27. package/example/android/gradle/wrapper/gradle-wrapper.properties +2 -1
  28. package/example/android/gradle.properties +42 -2
  29. package/example/android/gradlew +164 -105
  30. package/example/android/gradlew.bat +92 -89
  31. package/example/android/settings.gradle +2 -1
  32. package/example/app.json +1 -1
  33. package/example/ios/.xcode.env +11 -0
  34. package/example/ios/DocumentReader/AppDelegate.h +2 -4
  35. package/example/ios/DocumentReader/AppDelegate.mm +26 -0
  36. package/example/ios/DocumentReader/DocumentReader.entitlements +0 -1
  37. package/example/ios/DocumentReader/Images.xcassets/AppIcon.appiconset/Contents.json +30 -15
  38. package/example/ios/DocumentReader/Info.plist +8 -4
  39. package/example/ios/DocumentReader/main.m +2 -1
  40. package/example/ios/DocumentReader.xcodeproj/project.pbxproj +134 -96
  41. package/example/ios/DocumentReaderTests/DocumentReaderTests.m +14 -13
  42. package/example/ios/Podfile +45 -15
  43. package/example/jest.config.js +3 -0
  44. package/example/metro.config.js +18 -15
  45. package/example/package-lock.json +13091 -0
  46. package/example/package.json +32 -22
  47. package/example/tsconfig.json +3 -0
  48. package/index.d.ts +426 -3015
  49. package/index.js +253 -2954
  50. package/ios/RGLWJSONConstructor.h +8 -6
  51. package/ios/RGLWJSONConstructor.m +109 -92
  52. package/ios/RGLWRegulaConfig.h +2 -1
  53. package/ios/RGLWRegulaConfig.m +139 -41
  54. package/ios/RNRegulaDocumentReader.m +55 -42
  55. package/package.json +1 -1
  56. package/example/.buckconfig +0 -6
  57. package/example/.editorconfig +0 -3
  58. package/example/.flowconfig +0 -65
  59. package/example/.gitattributes +0 -3
  60. package/example/App.js +0 -399
  61. package/example/android/app/BUCK +0 -55
  62. package/example/android/app/_BUCK +0 -55
  63. package/example/android/app/build_defs.bzl +0 -19
  64. package/example/android/app/src/main/assets/index.android.bundle +0 -636
  65. package/example/android/app/src/main/res/drawable-mdpi/images_id.png +0 -0
  66. package/example/android/app/src/main/res/drawable-mdpi/images_portrait.png +0 -0
  67. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  68. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  69. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_indeterminate_check_box.png +0 -0
  70. package/example/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  71. package/example/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  72. package/example/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  73. package/example/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  74. package/example/ios/DocumentReader/AppDelegate.m +0 -62
  75. package/example/ios/DocumentReader/Base.lproj/LaunchScreen.xib +0 -42
@@ -114,16 +114,6 @@
114
114
  return hexInt;
115
115
  }
116
116
 
117
- +(UIImage*)imageFromBase64:(NSString *)base64image {
118
- NSMutableString *base64 = [NSMutableString stringWithString: base64image];
119
- if(![[base64image substringToIndex:10] isEqualToString:@"data:image"])
120
- base64 = [NSMutableString stringWithFormat: @"%@%@", @"data:image/jpeg;base64,", base64image];
121
- NSURL *url = [NSURL URLWithString:base64];
122
- NSData *imageData = [NSData dataWithContentsOfURL:url];
123
- UIImage *image = [UIImage imageWithData:imageData];
124
- return image;
125
- }
126
-
127
117
  +(CGLineCap)CGLineCapWithNSInteger:(NSInteger)value {
128
118
  switch(value){
129
119
  case 0:
@@ -205,6 +195,33 @@
205
195
  }
206
196
  }
207
197
 
198
+ +(NSNumber*)NSNumberWithRGLTextProcessing:(RGLTextProcessing*)value {
199
+ if(value == RGLTextProcessing.noChange)
200
+ return @0;
201
+ if(value == RGLTextProcessing.uppercase)
202
+ return @1;
203
+ if(value == RGLTextProcessing.lowercase)
204
+ return @2;
205
+ if(value == RGLTextProcessing.capital)
206
+ return @3;
207
+ return @0;
208
+ }
209
+
210
+ +(RGLTextProcessing*)RGLTextProcessingWithNSInteger:(NSNumber*)value {
211
+ switch([value integerValue]){
212
+ case 0:
213
+ return RGLTextProcessing.noChange;
214
+ case 1:
215
+ return RGLTextProcessing.uppercase;
216
+ case 2:
217
+ return RGLTextProcessing.lowercase;
218
+ case 3:
219
+ return RGLTextProcessing.capital;
220
+ default:
221
+ return RGLTextProcessing.noChange;
222
+ }
223
+ }
224
+
208
225
  +(NSInteger)NSIntegerWithAVCaptureDevicePosition:(AVCaptureDevicePosition)value {
209
226
  switch(value){
210
227
  case AVCaptureDevicePositionFront:
@@ -301,8 +318,8 @@
301
318
  image.moireCheck = [dict valueForKey:@"moireCheck"];
302
319
  if([dict valueForKey:@"expectedPass"] != nil){
303
320
  NSMutableArray<RGLImageQualityCheckType> *expectedPass = [NSMutableArray new];
304
- for(NSString* str in [dict valueForKey:@"expectedPass"])
305
- [expectedPass addObject:str];
321
+ for(NSNumber* item in [dict valueForKey:@"expectedPass"])
322
+ [expectedPass addObject:[self RGLImageQualityCheckTypeWithNSNumber: item]];
306
323
  image.expectedPass = expectedPass;
307
324
  }
308
325
  if([dict valueForKey:@"documentPositionIndent"] != nil)
@@ -321,12 +338,44 @@
321
338
  result[@"glaresCheck"] = input.glaresCheck;
322
339
  result[@"colornessCheck"] = input.colornessCheck;
323
340
  result[@"moireCheck"] = input.moireCheck;
324
- result[@"expectedPass"] = input.expectedPass;
341
+ if(input.expectedPass != nil) {
342
+ NSMutableArray* array = [NSMutableArray new];
343
+ for(RGLImageQualityCheckType item in input.expectedPass)
344
+ [array addObject:[self NSNumberWithRGLImageQualityCheckType:item]];
345
+ result[@"expectedPass"] = array;
346
+ } else result[@"expectedPass"] = nil;
325
347
  result[@"documentPositionIndent"] = input.documentPositionIndent;
326
348
 
327
349
  return result;
328
350
  }
329
351
 
352
+ +(NSNumber*)NSNumberWithRGLImageQualityCheckType:(RGLImageQualityCheckType)value {
353
+ if(value == RGLImageQualityCheckTypeImageGlares) return @0;
354
+ if(value == RGLImageQualityCheckTypeImageFocus) return @1;
355
+ if(value == RGLImageQualityCheckTypeImageResolution) return @2;
356
+ if(value == RGLImageQualityCheckTypeImageColorness) return @3;
357
+ if(value == RGLImageQualityCheckTypeImagePerspective) return @4;
358
+ if(value == RGLImageQualityCheckTypeImageBounds) return @5;
359
+ if(value == RGLImageQualityCheckTypeScreenCapture) return @6;
360
+ if(value == RGLImageQualityCheckTypePortrait) return @7;
361
+ if(value == RGLImageQualityCheckTypeHandwritten) return @8;
362
+ return 0;
363
+ }
364
+
365
+ +(RGLImageQualityCheckType)RGLImageQualityCheckTypeWithNSNumber:(NSNumber*)input {
366
+ int value = [input intValue];
367
+ if(value == 0) return RGLImageQualityCheckTypeImageGlares;
368
+ if(value == 1) return RGLImageQualityCheckTypeImageFocus;
369
+ if(value == 2) return RGLImageQualityCheckTypeImageResolution;
370
+ if(value == 3) return RGLImageQualityCheckTypeImageColorness;
371
+ if(value == 4) return RGLImageQualityCheckTypeImagePerspective;
372
+ if(value == 5) return RGLImageQualityCheckTypeImageBounds;
373
+ if(value == 6) return RGLImageQualityCheckTypeScreenCapture;
374
+ if(value == 7) return RGLImageQualityCheckTypePortrait;
375
+ if(value == 8) return RGLImageQualityCheckTypeHandwritten;
376
+ return RGLImageQualityCheckTypeImageGlares;
377
+ }
378
+
330
379
  +(RGLePassportDataGroup*)RGLePassportDataGroupFromJson:(NSDictionary*)dict {
331
380
  RGLePassportDataGroup *group = [[RGLePassportDataGroup alloc] init];
332
381
 
@@ -451,9 +500,12 @@
451
500
  }
452
501
 
453
502
  +(RGLOnlineProcessingConfig*)RGLOnlineProcessingConfigFromJSON:(NSDictionary*)dict {
503
+ if(dict == nil) return nil;
454
504
  if([dict valueForKey:@"mode"] == nil) return nil;
455
505
 
456
506
  RGLOnlineProcessingConfig *result = [[RGLOnlineProcessingConfig alloc] initWithMode:[[dict valueForKey:@"mode"] integerValue]];
507
+ if([dict valueForKey:@"url"] != nil)
508
+ result.serviceURL = [dict valueForKey:@"url"];
457
509
 
458
510
  if([dict valueForKey:@"imageFormat"] != nil)
459
511
  result.imageFormat = [[dict valueForKey:@"imageFormat"] integerValue];
@@ -477,6 +529,8 @@
477
529
  result.serviceURL = [dict valueForKey:@"serviceUrl"];
478
530
  if([dict valueForKey:@"failIfNoService"] != nil)
479
531
  result.failIfNoService = [dict valueForKey:@"failIfNoService"];
532
+ if([dict valueForKey:@"httpHeaders"] != nil)
533
+ result.httpHeaders = [dict valueForKey:@"httpHeaders"];
480
534
 
481
535
  return result;
482
536
  }
@@ -519,11 +573,11 @@
519
573
  if([options valueForKey:@"showNextPageAnimation"] != nil)
520
574
  customization.showNextPageAnimation = [[options valueForKey:@"showNextPageAnimation"] boolValue];
521
575
  if([options valueForKey:@"helpAnimationImage"] != nil)
522
- customization.helpAnimationImage = [self imageFromBase64:[options valueForKey:@"helpAnimationImage"]];
576
+ customization.helpAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"helpAnimationImage"]];
523
577
  if([options valueForKey:@"multipageAnimationFrontImage"] != nil)
524
- customization.multipageAnimationFrontImage = [self imageFromBase64:[options valueForKey:@"multipageAnimationFrontImage"]];
578
+ customization.multipageAnimationFrontImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"multipageAnimationFrontImage"]];
525
579
  if([options valueForKey:@"multipageAnimationBackImage"] != nil)
526
- customization.multipageAnimationBackImage = [self imageFromBase64:[options valueForKey:@"multipageAnimationBackImage"]];
580
+ customization.multipageAnimationBackImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"multipageAnimationBackImage"]];
527
581
  if([options valueForKey:@"tintColor"] != nil)
528
582
  customization.tintColor = [self getUIColorObjectFromHexString:[options valueForKey:@"tintColor"] alpha:1];
529
583
  if([options valueForKey:@"multipageButtonBackgroundColor"] != nil)
@@ -533,7 +587,7 @@
533
587
  if([options valueForKey:@"showBackgroundMask"] != nil)
534
588
  customization.showBackgroundMask = [[options valueForKey:@"showBackgroundMask"] boolValue];
535
589
  if([options valueForKey:@"borderBackgroundImage"] != nil)
536
- customization.borderBackgroundImage = [self imageFromBase64:[options valueForKey:@"borderBackgroundImage"]];
590
+ customization.borderBackgroundImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"borderBackgroundImage"]];
537
591
  if([options valueForKey:@"backgroundMaskAlpha"] != nil)
538
592
  customization.backgroundMaskAlpha = [[options valueForKey:@"backgroundMaskAlpha"] floatValue];
539
593
  if([options valueForKey:@"helpAnimationImageContentMode"] != nil)
@@ -553,19 +607,19 @@
553
607
  if([options valueForKey:@"cameraFrameCornerRadius"] != nil)
554
608
  customization.cameraFrameCornerRadius = [[options valueForKey:@"cameraFrameCornerRadius"] floatValue];
555
609
  if([options valueForKey:@"torchButtonOnImage"] != nil)
556
- customization.torchButtonOnImage = [self imageFromBase64:[options valueForKey:@"torchButtonOnImage"]];
610
+ customization.torchButtonOnImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOnImage"]];
557
611
  if([options valueForKey:@"torchButtonOffImage"] != nil)
558
- customization.torchButtonOffImage = [self imageFromBase64:[options valueForKey:@"torchButtonOffImage"]];
612
+ customization.torchButtonOffImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOffImage"]];
559
613
  if([options valueForKey:@"closeButtonImage"] != nil)
560
- customization.closeButtonImage = [self imageFromBase64:[options valueForKey:@"closeButtonImage"]];
614
+ customization.closeButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"closeButtonImage"]];
561
615
  if([options valueForKey:@"captureButtonImage"] != nil)
562
- customization.captureButtonImage = [self imageFromBase64:[options valueForKey:@"captureButtonImage"]];
616
+ customization.captureButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"captureButtonImage"]];
563
617
  if([options valueForKey:@"changeFrameButtonCollapseImage"] != nil)
564
- customization.changeFrameButtonCollapseImage = [self imageFromBase64:[options valueForKey:@"changeFrameButtonCollapseImage"]];
618
+ customization.changeFrameButtonCollapseImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"changeFrameButtonCollapseImage"]];
565
619
  if([options valueForKey:@"changeFrameButtonExpandImage"] != nil)
566
- customization.changeFrameButtonExpandImage = [self imageFromBase64:[options valueForKey:@"changeFrameButtonExpandImage"]];
620
+ customization.changeFrameButtonExpandImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"changeFrameButtonExpandImage"]];
567
621
  if([options valueForKey:@"cameraSwitchButtonImage"] != nil)
568
- customization.cameraSwitchButtonImage = [self imageFromBase64:[options valueForKey:@"cameraSwitchButtonImage"]];
622
+ customization.cameraSwitchButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"cameraSwitchButtonImage"]];
569
623
  if([options valueForKey:@"cameraFrameLineCap"] != nil)
570
624
  customization.cameraFrameLineCap = [self CGLineCapWithNSInteger:[[options valueForKey:@"cameraFrameLineCap"] integerValue]];
571
625
  if([options valueForKey:@"cameraFrameOffsetWidth"] != nil)
@@ -585,7 +639,7 @@
585
639
  if([options valueForKey:@"hologramAnimationPositionMultiplier"] != nil)
586
640
  customization.hologramAnimationPositionMultiplier = [[options valueForKey:@"hologramAnimationPositionMultiplier"] floatValue];
587
641
  if([options valueForKey:@"hologramAnimationImage"] != nil)
588
- customization.hologramAnimationImage = [self imageFromBase64:[options valueForKey:@"hologramAnimationImage"]];
642
+ customization.hologramAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"hologramAnimationImage"]];
589
643
  if([options valueForKey:@"uiCustomizationLayer"] != nil)
590
644
  customization.customUILayerJSON = [options valueForKey:@"uiCustomizationLayer"];
591
645
  }
@@ -764,18 +818,24 @@
764
818
  if([options valueForKey:@"processAuth"] != nil)
765
819
  processParams.processAuth = [options valueForKey:@"processAuth"];
766
820
  if([options valueForKey:@"documentGroupFilter"] != nil)
767
- processParams.documentGroupFilter = [options mutableArrayValueForKey:@"documentGroupFilter"];
821
+ processParams.documentGroupFilter = [options valueForKey:@"documentGroupFilter"];
768
822
  if([options valueForKey:@"convertCase"] != nil)
769
- processParams.convertCase = [options valueForKey:@"convertCase"];
823
+ processParams.convertCase = [RGLWRegulaConfig RGLTextProcessingWithNSInteger:[options valueForKey:@"convertCase"]];
770
824
  if([options valueForKey:@"rfidParams"] != nil)
771
825
  processParams.rfidParams = [self RGLRFIDParamsFromJSON:[options valueForKey:@"rfidParams"]];
826
+ if([options valueForKey:@"doDetectCan"] != nil)
827
+ processParams.doDetectCan = [NSNumber numberWithBool:[[options valueForKey:@"doDetectCan"] boolValue]];
828
+ if([options valueForKey:@"useFaceApi"] != nil)
829
+ processParams.useFaceApi = [NSNumber numberWithBool:[[options valueForKey:@"useFaceApi"] boolValue]];
830
+ if([options valueForKey:@"faceApiParams"] != nil)
831
+ processParams.faceApiParams = [self RGLFaceAPIParamsFromJSON:[options valueForKey:@"faceApiParams"]];
772
832
  }
773
833
 
774
834
  +(NSMutableDictionary *)getCustomization:(RGLCustomization*)customization {
775
835
  NSMutableDictionary *result = [[NSMutableDictionary alloc] init];
776
836
 
777
837
  result[@"showHelpAnimation"] = [NSNumber numberWithBool:customization.showHelpAnimation];
778
- result[@"helpAnimationImage"] = [UIImageJPEGRepresentation(customization.helpAnimationImage, 1.0) base64EncodedStringWithOptions:0];
838
+ result[@"helpAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.helpAnimationImage];
779
839
  result[@"showStatusMessages"] = [NSNumber numberWithBool:customization.showStatusMessages];
780
840
  result[@"status"] = customization.status;
781
841
  result[@"resultStatus"] = customization.resultStatus;
@@ -785,12 +845,12 @@
785
845
  result[@"resultStatusTextFont"] = customization.resultStatusTextFont.fontName;
786
846
  result[@"cameraFrameBorderWidth"] = [NSNumber numberWithFloat:customization.cameraFrameBorderWidth];
787
847
  result[@"statusTextFont"] = customization.statusTextFont.fontName;
788
- result[@"multipageAnimationFrontImage"] = [UIImageJPEGRepresentation(customization.multipageAnimationFrontImage, 1.0) base64EncodedStringWithOptions:0];
789
- result[@"multipageAnimationBackImage"] = [UIImageJPEGRepresentation(customization.multipageAnimationBackImage, 1.0) base64EncodedStringWithOptions:0];
848
+ result[@"multipageAnimationFrontImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageAnimationFrontImage];
849
+ result[@"multipageAnimationBackImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageAnimationBackImage];
790
850
  result[@"cameraFrameLineLength"] = [NSNumber numberWithFloat:customization.cameraFrameLineLength];
791
851
  result[@"showNextPageAnimation"] = [NSNumber numberWithBool:customization.showNextPageAnimation];
792
852
  result[@"showBackgroundMask"] = [NSNumber numberWithBool:customization.showBackgroundMask];
793
- result[@"borderBackgroundImage"] = [UIImageJPEGRepresentation(customization.borderBackgroundImage, 1.0) base64EncodedStringWithOptions:0];
853
+ result[@"borderBackgroundImage"] = [RGLWJSONConstructor base64WithImage:customization.borderBackgroundImage];
794
854
  result[@"backgroundMaskAlpha"] = [NSNumber numberWithFloat:customization.backgroundMaskAlpha];
795
855
  result[@"helpAnimationImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.helpAnimationImageContentMode]];
796
856
  result[@"multipageAnimationFrontImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.multipageAnimationFrontImageContentMode]];
@@ -799,13 +859,13 @@
799
859
  result[@"cameraFrameVerticalPositionMultiplier"] = [NSNumber numberWithFloat:customization.cameraFrameVerticalPositionMultiplier];
800
860
  result[@"customStatusPositionMultiplier"] = [NSNumber numberWithFloat:customization.customStatusPositionMultiplier];
801
861
  result[@"cameraFrameCornerRadius"] = [NSNumber numberWithFloat:customization.cameraFrameCornerRadius];
802
- result[@"torchButtonOnImage"] = [UIImageJPEGRepresentation(customization.torchButtonOnImage, 1.0) base64EncodedStringWithOptions:0];
803
- result[@"torchButtonOffImage"] = [UIImageJPEGRepresentation(customization.torchButtonOffImage, 1.0) base64EncodedStringWithOptions:0];
804
- result[@"closeButtonImage"] = [UIImageJPEGRepresentation(customization.closeButtonImage, 1.0) base64EncodedStringWithOptions:0];
805
- result[@"captureButtonImage"] = [UIImageJPEGRepresentation(customization.captureButtonImage, 1.0) base64EncodedStringWithOptions:0];
806
- result[@"changeFrameButtonCollapseImage"] = [UIImageJPEGRepresentation(customization.changeFrameButtonCollapseImage, 1.0) base64EncodedStringWithOptions:0];
807
- result[@"changeFrameButtonExpandImage"] = [UIImageJPEGRepresentation(customization.changeFrameButtonExpandImage, 1.0) base64EncodedStringWithOptions:0];
808
- result[@"cameraSwitchButtonImage"] = [UIImageJPEGRepresentation(customization.cameraSwitchButtonImage, 1.0) base64EncodedStringWithOptions:0];
862
+ result[@"torchButtonOnImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOnImage];
863
+ result[@"torchButtonOffImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOffImage];
864
+ result[@"closeButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.closeButtonImage];
865
+ result[@"captureButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.captureButtonImage];
866
+ result[@"changeFrameButtonCollapseImage"] = [RGLWJSONConstructor base64WithImage:customization.changeFrameButtonCollapseImage];
867
+ result[@"changeFrameButtonExpandImage"] = [RGLWJSONConstructor base64WithImage:customization.changeFrameButtonExpandImage];
868
+ result[@"cameraSwitchButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.cameraSwitchButtonImage];
809
869
  result[@"cameraFrameLineCap"] = [NSNumber numberWithInteger:[self NSIntegerWithCGLineCap:customization.cameraFrameLineCap]];
810
870
  result[@"cameraFrameOffsetWidth"] = [NSNumber numberWithFloat:customization.cameraFrameOffsetWidth];
811
871
  result[@"cameraFramePortraitAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFramePortraitAspectRatio];
@@ -814,7 +874,7 @@
814
874
  result[@"hologramAnimationImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.hologramAnimationImageContentMode]];
815
875
  result[@"hologramAnimationPositionMultiplier"] = [NSNumber numberWithFloat:customization.hologramAnimationPositionMultiplier];
816
876
  result[@"uiCustomizationLayer"] = customization.customUILayerJSON;
817
- result[@"hologramAnimationImage"] = [UIImageJPEGRepresentation(customization.hologramAnimationImage, 1.0) base64EncodedStringWithOptions:0];
877
+ result[@"hologramAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.hologramAnimationImage];
818
878
  if(customization.customLabelStatus != nil)
819
879
  result[@"customLabelStatus"] = customization.customLabelStatus.string;
820
880
  if(customization.activityIndicatorColor != nil)
@@ -932,7 +992,9 @@
932
992
  result[@"splitNames"] = processParams.splitNames;
933
993
  result[@"processAuth"] = processParams.processAuth;
934
994
  result[@"documentGroupFilter"] = processParams.documentGroupFilter;
935
- result[@"convertCase"] = processParams.convertCase;
995
+ result[@"convertCase"] = [RGLWRegulaConfig NSNumberWithRGLTextProcessing:processParams.convertCase];
996
+ result[@"doDetectCan"] = [NSNumber numberWithBool:processParams.doDetectCan];
997
+ result[@"useFaceApi"] = [NSNumber numberWithBool:processParams.useFaceApi];
936
998
 
937
999
  return result;
938
1000
  }
@@ -1037,7 +1099,7 @@
1037
1099
  if([options valueForKey:@"authorizedInstallQCert"] != nil)
1038
1100
  rfidScenario.authorizedInstallQCert = [[options valueForKey:@"authorizedInstallQCert"] boolValue];
1039
1101
  if([options valueForKey:@"reprocessParams"] != nil)
1040
- rfidScenario.reprocParams = [self RGLReprocParamsFromJSON: [options valueForKey:@"reprocessParams"]];
1102
+ rfidScenario.reprocParams = [self RGLReprocParamsFromJSON:[options valueForKey:@"reprocessParams"]];
1041
1103
  if([options valueForKey:@"defaultReadingBufferSize"] != nil)
1042
1104
  rfidScenario.defaultReadingBufferSize = [[options valueForKey:@"defaultReadingBufferSize"] intValue];
1043
1105
  }
@@ -1051,4 +1113,40 @@
1051
1113
  return result;
1052
1114
  }
1053
1115
 
1116
+ +(RGLFaceAPIParams*)RGLFaceAPIParamsFromJSON:(NSDictionary*)input {
1117
+ RGLFaceAPIParams* result = [RGLFaceAPIParams new];
1118
+
1119
+ if([input valueForKey:@"url"] != nil)
1120
+ result.url = [input valueForKey:@"url"];
1121
+ if([input valueForKey:@"mode"] != nil)
1122
+ result.mode = [input valueForKey:@"mode"];
1123
+ if([input valueForKey:@"threshold"] != nil)
1124
+ result.threshold = [input valueForKey:@"threshold"];
1125
+ if([input valueForKey:@"searchParams"] != nil)
1126
+ result.searchParams = [self RGLFaceAPISearchParamsFromJSON:[input valueForKey:@"searchParams"]];
1127
+ if([input valueForKey:@"serviceTimeout"] != nil)
1128
+ result.serviceTimeout = [input valueForKey:@"serviceTimeout"];
1129
+ if([input valueForKey:@"proxy"] != nil)
1130
+ result.proxy = [input valueForKey:@"proxy"];
1131
+ if([input valueForKey:@"proxyPassword"] != nil)
1132
+ result.proxyPassword = [input valueForKey:@"proxyPassword"];
1133
+ if([input valueForKey:@"proxyType"] != nil)
1134
+ result.proxyType = [input valueForKey:@"proxyType"];
1135
+
1136
+ return result;
1137
+ }
1138
+
1139
+ +(RGLFaceAPISearchParams*)RGLFaceAPISearchParamsFromJSON:(NSDictionary*)input {
1140
+ RGLFaceAPISearchParams* result = [RGLFaceAPISearchParams new];
1141
+
1142
+ if([input valueForKey:@"limit"] != nil)
1143
+ result.limit = [input valueForKey:@"limit"];
1144
+ if([input valueForKey:@"threshold"] != nil)
1145
+ result.threshold = [input valueForKey:@"threshold"];
1146
+ if([input valueForKey:@"groupIds"] != nil)
1147
+ result.groupIDs = [input valueForKey:@"groupIds"];
1148
+
1149
+ return result;
1150
+ }
1151
+
1054
1152
  @end
@@ -1,21 +1,27 @@
1
1
  @import UIKit;
2
2
  #import "RNRegulaDocumentReader.h"
3
3
 
4
+ RGLRFIDCertificatesCallback RGLWPaCertificateCompletion;
5
+ RGLRFIDCertificatesCallback RGLWTaCertificateCompletion;
6
+ RGLWRFIDSignatureCallback RGLWTaSignatureCompletion;
7
+
4
8
  NSString* RGLWPrepareDatabaseProgressChangeEvent = @"prepareDatabaseProgressChangeEvent";
5
9
  NSString* RGLWCompletionEvent = @"completionEvent";
6
- NSString* RGLWVideoEncoderCompletionEvent = @"videoEncoderCompletionEvent";
7
- NSString* RGLWRfidNotificationCompletionEvent = @"rfidNotificationCompletionEvent";
10
+
11
+ NSString* RGLWRfidOnProgressEvent = @"rfidNotificationCompletionEvent";
12
+ NSString* RGLWRfidOnChipDetectedEvent = @"rfidOnChipDetectedEvent";
13
+ NSString* RGLWRfidOnRetryReadChipEvent = @"rfidOnRetryReadChipEvent";
14
+
8
15
  NSString* RGLWPaCertificateCompletionEvent = @"paCertificateCompletionEvent";
9
16
  NSString* RGLWTaCertificateCompletionEvent = @"taCertificateCompletionEvent";
10
17
  NSString* RGLWTaSignatureCompletionEvent = @"taSignatureCompletionEvent";
18
+
11
19
  NSString* RGLWBleOnServiceConnectedEvent = @"bleOnServiceConnectedEvent";
12
20
  NSString* RGLWBleOnServiceDisconnectedEvent = @"bleOnServiceDisconnectedEvent";
13
21
  NSString* RGLWBleOnDeviceReadyEvent = @"bleOnDeviceReadyEvent";
14
- NSString* RGLWOnCustomButtonTappedEvent = @"onCustomButtonTappedEvent";
15
22
 
16
- RGLRFIDCertificatesCallback RGLWPaCertificateCompletion;
17
- RGLRFIDCertificatesCallback RGLWTaCertificateCompletion;
18
- RGLWRFIDSignatureCallback RGLWTaSignatureCompletion;
23
+ NSString* RGLWVideoEncoderCompletionEvent = @"videoEncoderCompletionEvent";
24
+ NSString* RGLWOnCustomButtonTappedEvent = @"onCustomButtonTappedEvent";
19
25
 
20
26
  RGLWRFIDDelegateNoPA* RGLWRfidDelegateNoPA;
21
27
 
@@ -34,11 +40,14 @@ RNRegulaDocumentReader* RGLWPlugin;
34
40
  }
35
41
 
36
42
  - (void)didChipConnected {
37
- [RGLWPlugin sendEventWithName:RGLWRfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletion:1]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
43
+ [RGLWPlugin sendEventWithName:RGLWRfidOnChipDetectedEvent body:@{@"msg": @""}];
44
+
38
45
  }
39
46
 
40
47
  - (void)didReceivedError:(RGLRFIDErrorCodes)errorCode {
41
- [RGLWPlugin sendEventWithName:RGLWRfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletionWithError:2:errorCode]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
48
+ NSMutableDictionary *result = [NSMutableDictionary new];
49
+ result[@"errorCode"] = [NSNumber numberWithInteger:errorCode];
50
+ [RGLWPlugin sendEventWithName:RGLWRfidOnRetryReadChipEvent body:@{@"msg": [RGLWJSONConstructor dictToString:result]}];
42
51
  }
43
52
 
44
53
  @end
@@ -51,7 +60,9 @@ RCT_EXPORT_MODULE();
51
60
  return @[RGLWPrepareDatabaseProgressChangeEvent,
52
61
  RGLWCompletionEvent,
53
62
  RGLWVideoEncoderCompletionEvent,
54
- RGLWRfidNotificationCompletionEvent,
63
+ RGLWRfidOnProgressEvent,
64
+ RGLWRfidOnChipDetectedEvent,
65
+ RGLWRfidOnRetryReadChipEvent,
55
66
  RGLWPaCertificateCompletionEvent,
56
67
  RGLWTaCertificateCompletionEvent,
57
68
  RGLWTaSignatureCompletionEvent,
@@ -83,19 +94,19 @@ static NSNumber* _databasePercentageDownloaded;
83
94
 
84
95
  -(RGLDocumentReaderCompletion _Nonnull)getCompletion {
85
96
  return ^(RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error) {
86
- [self sendEventWithName:RGLWCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateDocReaderAction: action] :results :error :nil]]}];
97
+ [self sendEventWithName:RGLWCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateDocReaderAction: action] :results :error]]}];
87
98
  };
88
99
  }
89
100
 
90
101
  -(RGLRFIDProcessCompletion _Nonnull)getRFIDCompletion {
91
102
  return ^(RGLRFIDCompleteAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error, RGLRFIDErrorCodes errorCode) {
92
- [self sendEventWithName:RGLWCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateRFIDCompleteAction: action] :results :error :nil]]}];
103
+ [self sendEventWithName:RGLWCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateRFIDCompleteAction: action] :results :error]]}];
93
104
  };
94
105
  }
95
106
 
96
107
  -(RGLRFIDNotificationCallback _Nonnull)getRFIDNotificationCallback {
97
- return ^(RGLRFIDNotificationAction notificationAction, RGLRFIDNotify* _Nullable notify) {
98
- [self sendEventWithName:RGLWCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateRFIDNotificationAction:notificationAction] :nil :nil :notify]]}];
108
+ return ^(RGLRFIDNotificationAction action, RGLRFIDNotify* _Nullable notification) {
109
+ [self sendEventWithName:RGLWRfidOnProgressEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateDocumentReaderNotification:notification]]}];
99
110
  };
100
111
  }
101
112
 
@@ -123,11 +134,14 @@ static NSNumber* _databasePercentageDownloaded;
123
134
  }
124
135
 
125
136
  - (void)didChipConnected {
126
- [RGLWPlugin sendEventWithName:RGLWRfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletion:1]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
137
+ [RGLWPlugin sendEventWithName:RGLWRfidOnChipDetectedEvent body:@{@"msg": @""}];
138
+
127
139
  }
128
140
 
129
141
  - (void)didReceivedError:(RGLRFIDErrorCodes)errorCode {
130
- [RGLWPlugin sendEventWithName:RGLWRfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletionWithError:2:errorCode]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
142
+ NSMutableDictionary *result = [NSMutableDictionary new];
143
+ result[@"errorCode"] = [NSNumber numberWithInteger:errorCode];
144
+ [RGLWPlugin sendEventWithName:RGLWRfidOnRetryReadChipEvent body:@{@"msg": [RGLWJSONConstructor dictToString:result]}];
131
145
  }
132
146
 
133
147
  - (void)onCustomButtonTappedWithTag:(NSInteger)tag {
@@ -237,8 +251,10 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
237
251
  [self setTag :[args objectAtIndex:0] :successCallback :errorCallback];
238
252
  else if([action isEqualToString:@"checkDatabaseUpdate"])
239
253
  [self checkDatabaseUpdate :[args objectAtIndex:0] :successCallback :errorCallback];
240
- else if([action isEqualToString:@"getScenario"])
241
- [self getScenario :[args objectAtIndex:0] :successCallback :errorCallback];
254
+ else if([action isEqualToString:@"scan"])
255
+ [self scan :[args objectAtIndex:0] :successCallback :errorCallback];
256
+ else if([action isEqualToString:@"recognize"])
257
+ [self recognize :[args objectAtIndex:0] :successCallback :errorCallback];
242
258
  else if([action isEqualToString:@"recognizeImages"])
243
259
  [self recognizeImages :[args objectAtIndex:0] :successCallback :errorCallback];
244
260
  else if([action isEqualToString:@"showScannerWithCameraID"])
@@ -279,8 +295,6 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
279
295
  [self recognizeImageWithCameraMode :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
280
296
  else if([action isEqualToString:@"recognizeImagesWithImageInputs"])
281
297
  [self recognizeImagesWithImageInputs :[args objectAtIndex:0] :successCallback :errorCallback];
282
- else if([action isEqualToString:@"setOnCustomButtonTappedListener"])
283
- [self setOnCustomButtonTappedListener :successCallback :errorCallback];
284
298
  else if([action isEqualToString:@"setLanguage"])
285
299
  [self setLanguage :[args objectAtIndex:0] :successCallback :errorCallback];
286
300
  else if([action isEqualToString:@"textFieldValueByType"])
@@ -376,11 +390,6 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
376
390
  [self result:@"getLicenseMessage() is an android-only method" :successCallback];
377
391
  }
378
392
 
379
- - (void) setOnCustomButtonTappedListener:(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
380
- RGLDocReader.shared.customization.actionDelegate = self;
381
- [self result:@"" :successCallback];
382
- }
383
-
384
393
  - (void) setLanguage:(NSString*)language :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
385
394
  RGLDocReader.shared.localizationHandler = ^NSString * _Nullable(NSString * _Nonnull localizationKey) {
386
395
  NSString *result = NSLocalizedStringFromTable(localizationKey, language, @"");
@@ -448,7 +457,7 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
448
457
  - (void) recognizeImages:(NSArray*)input :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
449
458
  NSMutableArray<UIImage*>* images = [[NSMutableArray alloc] init];
450
459
  for(__strong NSMutableString* base64 in input)
451
- [images addObject:[UIImage imageWithData:[[NSData alloc]initWithBase64EncodedString:base64 options:NSDataBase64DecodingIgnoreUnknownCharacters]]];
460
+ [images addObject:[RGLWJSONConstructor imageWithBase64:base64]];
452
461
  dispatch_async(dispatch_get_main_queue(), ^{
453
462
  [RGLDocReader.shared recognizeImages:images completion:[self getCompletion]];
454
463
  });
@@ -470,7 +479,7 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
470
479
 
471
480
  - (void) recognizeImageWith:(NSMutableString*)base64 :(BOOL)cameraMode :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
472
481
  dispatch_async(dispatch_get_main_queue(), ^{
473
- [RGLDocReader.shared recognizeImage:[UIImage imageWithData:[[NSData alloc]initWithBase64EncodedString:base64 options:NSDataBase64DecodingIgnoreUnknownCharacters]] cameraMode:cameraMode completion:[self getCompletion]];
482
+ [RGLDocReader.shared recognizeImage:[RGLWJSONConstructor imageWithBase64:base64] cameraMode:cameraMode completion:[self getCompletion]];
474
483
  });
475
484
  }
476
485
 
@@ -553,6 +562,21 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
553
562
  [self result:@"" :successCallback];
554
563
  }
555
564
 
565
+ - (void) scan:(NSDictionary*)config :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
566
+ dispatch_async(dispatch_get_main_queue(), ^{
567
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
568
+ [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
569
+ #pragma clang diagnostic pop
570
+ UIViewController *currentViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
571
+ [RGLDocReader.shared showScannerFromPresenter:currentViewController config:[RGLWJSONConstructor RGLScannerConfigFromJson:config] completion:[self getCompletion]];
572
+ });
573
+ }
574
+
575
+ - (void) recognize:(NSDictionary*)config :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
576
+ UIViewController *currentViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
577
+ [RGLDocReader.shared recognizeImageFromPresenter:currentViewController config:[RGLWJSONConstructor RGLRecognizeConfigFromJson:config] completion:[self getCompletion]];
578
+ }
579
+
556
580
  - (void) getDocumentReaderIsReady:(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
557
581
  [self result:[RGLDocReader.shared isDocumentReaderIsReady] ? @YES : @NO :successCallback];
558
582
  }
@@ -654,18 +678,6 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
654
678
  [self result:RGLDocReader.shared.processParams.sessionLogFolder :successCallback];
655
679
  }
656
680
 
657
- - (void) getScenario:(NSString*)scenarioID :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
658
- BOOL success = false;
659
- for(RGLScenario *scenario in RGLDocReader.shared.availableScenarios)
660
- if([scenario.identifier isEqualToString:scenarioID]){
661
- [self result:[RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRGLScenario:scenario]] :successCallback];
662
- success = true;
663
- break;
664
- }
665
- if(!success)
666
- [self result:@"Scenario unavailable" :errorCallback];
667
- }
668
-
669
681
  - (void) providePACertificates:(NSArray*)input :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
670
682
  if(RGLWPaCertificateCompletion == nil){
671
683
  [self result:@"paCertificateCompletion is nil" :errorCallback];
@@ -799,22 +811,22 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
799
811
 
800
812
  - (void) graphicFieldImageByType:(NSString*)rawResult :(NSNumber*)fieldType :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
801
813
  RGLDocumentReaderResults* results = [RGLDocumentReaderResults initWithRawString:rawResult];
802
- [self result:[UIImageJPEGRepresentation([results getGraphicFieldImageByType:[fieldType integerValue]], 1.0) base64EncodedStringWithOptions:0] :successCallback];
814
+ [self result:[RGLWJSONConstructor base64WithImage:[results getGraphicFieldImageByType:[fieldType integerValue]]] :successCallback];
803
815
  }
804
816
 
805
817
  - (void) graphicFieldImageByTypeSource:(NSString*)rawResult :(NSNumber*)fieldType :(NSNumber*)source :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
806
818
  RGLDocumentReaderResults* results = [RGLDocumentReaderResults initWithRawString:rawResult];
807
- [self result:[UIImageJPEGRepresentation([results getGraphicFieldImageByType:[fieldType integerValue] source:[source integerValue]], 1.0) base64EncodedStringWithOptions:0] :successCallback];
819
+ [self result:[RGLWJSONConstructor base64WithImage:[results getGraphicFieldImageByType:[fieldType integerValue] source:[source integerValue]]] :successCallback];
808
820
  }
809
821
 
810
822
  - (void) graphicFieldImageByTypeSourcePageIndex:(NSString*)rawResult :(NSNumber*)fieldType :(NSNumber*)source :(NSNumber*)pageIndex :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
811
823
  RGLDocumentReaderResults* results = [RGLDocumentReaderResults initWithRawString:rawResult];
812
- [self result:[UIImageJPEGRepresentation([results getGraphicFieldImageByType:[fieldType integerValue] source:[source integerValue] pageIndex:[pageIndex integerValue]], 1.0) base64EncodedStringWithOptions:0] :successCallback];
824
+ [self result:[RGLWJSONConstructor base64WithImage:[results getGraphicFieldImageByType:[fieldType integerValue] source:[source integerValue] pageIndex:[pageIndex integerValue]]] :successCallback];
813
825
  }
814
826
 
815
827
  - (void) graphicFieldImageByTypeSourcePageIndexLight:(NSString*)rawResult :(NSNumber*)fieldType :(NSNumber*)source :(NSNumber*)pageIndex :(NSNumber*)light :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
816
828
  RGLDocumentReaderResults* results = [RGLDocumentReaderResults initWithRawString:rawResult];
817
- [self result:[UIImageJPEGRepresentation([results getGraphicFieldImageByType:[fieldType integerValue] source:[source integerValue] pageIndex:[pageIndex integerValue] light:[light integerValue]], 1.0) base64EncodedStringWithOptions:0] :successCallback];
829
+ [self result:[RGLWJSONConstructor base64WithImage:[results getGraphicFieldImageByType:[fieldType integerValue] source:[source integerValue] pageIndex:[pageIndex integerValue] light:[light integerValue]]] :successCallback];
818
830
  }
819
831
 
820
832
  - (void) containers:(NSString*)rawResult :(NSArray<NSNumber*>*)resultType :(RGLWCallback)successCallback :(RGLWCallback)errorCallback{
@@ -831,6 +843,7 @@ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(R
831
843
  return ^(BOOL successful, NSError * _Nullable error ) {
832
844
  if (successful){
833
845
  [RGLDocReader shared].functionality.recordScanningProcessDelegate = self;
846
+ RGLDocReader.shared.customization.actionDelegate = self;
834
847
  [self result:@"init complete" :successCallback];
835
848
  }else
836
849
  [self result:[NSString stringWithFormat:@"%@/%@", @"init failed: ", error.description] :errorCallback];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/react-native-document-reader-api",
3
- "version": "6.8.1",
3
+ "version": "6.9.0",
4
4
  "description": "React Native module for reading and validation of identification documents (API framework)",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,6 +0,0 @@
1
-
2
- [android]
3
- target = Google Inc.:Google APIs:23
4
-
5
- [maven_repositories]
6
- central = https://repo1.maven.org/maven2
@@ -1,3 +0,0 @@
1
- # Windows files
2
- [*.bat]
3
- end_of_line = crlf
@@ -1,65 +0,0 @@
1
- [ignore]
2
- ; We fork some components by platform
3
- .*/*[.]android.js
4
-
5
- ; Ignore "BUCK" generated dirs
6
- <PROJECT_ROOT>/\.buckd/
7
-
8
- ; Ignore polyfills
9
- node_modules/react-native/Libraries/polyfills/.*
10
-
11
- ; Flow doesn't support platforms
12
- .*/Libraries/Utilities/LoadingView.js
13
-
14
- [untyped]
15
- .*/node_modules/@react-native-community/cli/.*/.*
16
-
17
- [include]
18
-
19
- [libs]
20
- node_modules/react-native/interface.js
21
- node_modules/react-native/flow/
22
-
23
- [options]
24
- emoji=true
25
-
26
- exact_by_default=true
27
-
28
- format.bracket_spacing=false
29
-
30
- module.file_ext=.js
31
- module.file_ext=.json
32
- module.file_ext=.ios.js
33
-
34
- munge_underscores=true
35
-
36
- module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
37
- module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
38
-
39
- suppress_type=$FlowIssue
40
- suppress_type=$FlowFixMe
41
- suppress_type=$FlowFixMeProps
42
- suppress_type=$FlowFixMeState
43
-
44
- [lints]
45
- sketchy-null-number=warn
46
- sketchy-null-mixed=warn
47
- sketchy-number=warn
48
- untyped-type-import=warn
49
- nonstrict-import=warn
50
- deprecated-type=warn
51
- unsafe-getters-setters=warn
52
- unnecessary-invariant=warn
53
- signature-verification-failure=warn
54
-
55
- [strict]
56
- deprecated-type
57
- nonstrict-import
58
- sketchy-null
59
- unclear-type
60
- unsafe-getters-setters
61
- untyped-import
62
- untyped-type-import
63
-
64
- [version]
65
- ^0.158.0
@@ -1,3 +0,0 @@
1
- # Windows files should use crlf line endings
2
- # https://help.github.com/articles/dealing-with-line-endings/
3
- *.bat text eol=crlf