From be08a6fc74431b3d5a4f254707d9cc9372b27d84 Mon Sep 17 00:00:00 2001 From: Renato Neves Ribeiro Date: Tue, 31 Aug 2021 11:50:38 +0200 Subject: [PATCH 1/6] Native barcode was not being enabled when added to the config files, added a line to extract the options dictionary to make sure we have access to it. --- plugin/ios/AnylineSDKPlugin.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugin/ios/AnylineSDKPlugin.m b/plugin/ios/AnylineSDKPlugin.m index 909e1308..3eef8f8b 100644 --- a/plugin/ios/AnylineSDKPlugin.m +++ b/plugin/ios/AnylineSDKPlugin.m @@ -79,16 +79,16 @@ -(void)initView:(NSString *)scanMode { if(error) { [NSException raise:@"Config could not be parsed to JSON" format:@"Config could not be parsed to JSON: %@", error.localizedDescription]; } - + NSDictionary *optionsDictionary = [dictionary objectForKey:@"options"]; self.jsonConfigDictionary = dictionary; self.appKey = [dictionary objectForKey:@"license"]; - BOOL nativeBarcodeScanning = [[dictionary objectForKey:@"nativeBarcodeEnabled"] boolValue]; + BOOL nativeBarcodeScanning = [[optionsDictionary objectForKey:@"nativeBarcodeEnabled"] boolValue]; self.nativeBarcodeScanning = nativeBarcodeScanning ? nativeBarcodeScanning : NO; - self.jsonUIConf = [[ALJsonUIConfiguration alloc] initWithDictionary:[dictionary objectForKey:@"options"]]; - self.conf = [[ALScanViewPluginConfig alloc] initWithDictionary:[dictionary objectForKey:@"options"]]; + self.jsonUIConf = [[ALJsonUIConfiguration alloc] initWithDictionary:optionsDictionary]; + self.conf = [[ALScanViewPluginConfig alloc] initWithDictionary:optionsDictionary]; self.conf.cancelOnResult = true; self.ocrConfigDict = [dictionary objectForKey:@"ocr"]; @@ -113,7 +113,7 @@ -(void)initView:(NSString *)scanMode { nfcScanViewController.cropAndTransformErrorMessage = str; } - if ([self.jsonConfigDictionary valueForKey:@"nativeBarcodeEnabled"]) { + if ([optionsDictionary valueForKey:@"nativeBarcodeEnabled"]) { nfcScanViewController.nativeBarcodeEnabled = [[self.jsonConfigDictionary objectForKey:@"nativeBarcodeEnabled"] boolValue]; } @@ -143,7 +143,7 @@ -(void)initView:(NSString *)scanMode { pluginScanViewController.cropAndTransformErrorMessage = str; } - if ([self.jsonConfigDictionary valueForKey:@"nativeBarcodeEnabled"]) { + if ([optionsDictionary valueForKey:@"nativeBarcodeEnabled"]) { pluginScanViewController.nativeBarcodeEnabled = [[self.jsonConfigDictionary objectForKey:@"nativeBarcodeEnabled"] boolValue]; } @@ -168,7 +168,7 @@ -(void)initView:(NSString *)scanMode { pluginScanViewController.cropAndTransformErrorMessage = str; } - if ([self.jsonConfigDictionary valueForKey:@"nativeBarcodeEnabled"]) { + if ([optionsDictionary valueForKey:@"nativeBarcodeEnabled"]) { pluginScanViewController.nativeBarcodeEnabled = [[self.jsonConfigDictionary objectForKey:@"nativeBarcodeEnabled"] boolValue]; } From 46e5e2ce9643c59ef69ade9edf5e4036bba9182b Mon Sep 17 00:00:00 2001 From: Renato Neves Ribeiro Date: Tue, 5 Oct 2021 16:58:08 +0200 Subject: [PATCH 2/6] adding cyrillic to release 34 and bumping example app version --- example/RNExampleApp/config/ArabicIdConfig.js | 3 +- .../RNExampleApp/config/CyrillicIdConfig.js | 98 +++++++++++++++++++ .../RNExampleApp/ios/RNExampleApp/Info.plist | 2 +- example/RNExampleApp/src/Overview.js | 7 ++ example/RNExampleApp/src/index.js | 4 + 5 files changed, 112 insertions(+), 2 deletions(-) create mode 100755 example/RNExampleApp/config/CyrillicIdConfig.js diff --git a/example/RNExampleApp/config/ArabicIdConfig.js b/example/RNExampleApp/config/ArabicIdConfig.js index b46b9479..2b107ba6 100755 --- a/example/RNExampleApp/config/ArabicIdConfig.js +++ b/example/RNExampleApp/config/ArabicIdConfig.js @@ -15,7 +15,8 @@ export default { "plugin":{ "id":"ID", "idPlugin": { - "arabicIdConfig": { + "universalIdConfig": { + "alphabet" : "arabic", "faceDetection": true, "allowedLayouts": { "mrz": [], diff --git a/example/RNExampleApp/config/CyrillicIdConfig.js b/example/RNExampleApp/config/CyrillicIdConfig.js new file mode 100755 index 00000000..e86f35ed --- /dev/null +++ b/example/RNExampleApp/config/CyrillicIdConfig.js @@ -0,0 +1,98 @@ +export default { + license: 'ewogICJsaWNlbnNlS2V5VmVyc2lvbiI6IDIsCiAgImRlYnVnUmVwb3J0aW5nIjogIm9uIiwKICAiaW1hZ2VSZXBvcnRDYWNoaW5nIjogZmFsc2UsCiAgIm1ham9yVmVyc2lvbiI6ICIyNSIsCiAgIm1heERheXNOb3RSZXBvcnRlZCI6IDUsCiAgImFkdmFuY2VkQmFyY29kZSI6IHRydWUsCiAgIm11bHRpQmFyY29kZSI6IHRydWUsCiAgInN1cHBvcnRlZEJhcmNvZGVGb3JtYXRzIjogWwogICAgIkFMTCIKICBdLAogICJwaW5nUmVwb3J0aW5nIjogdHJ1ZSwKICAicGxhdGZvcm0iOiBbCiAgICAiaU9TIiwKICAgICJBbmRyb2lkIgogIF0sCiAgInNjb3BlIjogWwogICAgIkFMTCIKICBdLAogICJzaG93UG9wVXBBZnRlckV4cGlyeSI6IGZhbHNlLAogICJzaG93V2F0ZXJtYXJrIjogdHJ1ZSwKICAidG9sZXJhbmNlRGF5cyI6IDkwLAogICJ2YWxpZCI6ICIyMDIxLTEyLTMxIiwKICAiaW9zSWRlbnRpZmllciI6IFsKICAgICJjb20uYW55bGluZS5leGFtcGxlLnJlYWN0bmF0aXZlIiwKICAgICJjb20uYW55bGluZS5leGFtcGxlLnJlYWN0bmF0aXZlLmJldGEiCiAgXSwKICAiYW5kcm9pZElkZW50aWZpZXIiOiBbCiAgICAiY29tLmFueWxpbmUuZXhhbXBsZS5yZWFjdG5hdGl2ZSIKICBdCn0KekFjQVc4dmI0UjdPd0hkYkhyZkdIVlNIcVVkTzNudDd3clBPbi9XNXJkajhuK0lJSkNiRjdrSXJEOGVFVkVmU2htM2dmSzBXWnBWTGhmekFQbVRNYkU4VnU0bWVqZC9KMktCTms3d2NTa3RRbmRYUko2V2RuTmxMZS9uUFNSM1RvWXdQMVU3WG0zb01MVGErdFNRaElubDlvZXhYUkFMT25ZM1J5OUY0d0lKcUxMeUMxcmVieXFMcDJwRGx6N3RCeHNkd2ZLZEx3TkQrQWtJUGxKQmNrbUlGN2lIREJLOW55aVNCMXJPMUxET2VEOUJZMlNZU0UwelR1Z2I1bzN2UG9kenYxYldhVmpMS05vcGw1QVNGU3BKcjdNZE9oN2hvMW5rcGk4Rm5uVFJCUko4QklSb2dGRmI4SUQxOXdvdlk3M1BqMGI2dkdabGxucElDTm1UNnFBPT0=', + options: { + "camera" : { + "captureResolution" : "1080p", + "zoomGesture": true + }, + "flash" : { + "mode": "manual", + "alignment": "bottom_right", + "imageOn": "flash_on", + "imageOff": "flash_off" + }, + "viewPlugin" : { + "plugin":{ + "id":"ID", + "idPlugin": { + "universalIdConfig": { + "alphabet" : "cyrillic", + "faceDetection": true, + "allowedLayouts": { + "mrz": [], + "drivingLicense": [], + "idFront": [] + }, + "drivingLicense": { + "lastName": {"scanOption": 0, "minConfidence": 40}, + "lastName@cyr": {"scanOption": 0, "minConfidence": 40}, + "firstName": {"scanOption": 0, "minConfidence": 40}, + "firstName@cyr": {"scanOption": 0, "minConfidence": 40}, + "dateOfBirth": {"scanOption": 0, "minConfidence": 50}, + "placeOfBirth": {"scanOption": 1, "minConfidence": 50}, + "dateOfIssue": {"scanOption": 0, "minConfidence": 50}, + "dateOfExpiry": {"scanOption": 1, "minConfidence": 50}, + "authority": {"scanOption": 1, "minConfidence": 30}, + "documentNumber": {"scanOption": 0, "minConfidence": 40}, + "address": {"scanOption": 1}, + "address@cyr": {"scanOption": 1}, + "nationality": {"scanOption": 1}, + "nationality@cyr": {"scanOption": 1} + }, + "idFront": { + "lastName": {"scanOption": 0, "minConfidence": 40}, + "lastName@cyr": {"scanOption": 0, "minConfidence": 40}, + "firstName": {"scanOption": 0, "minConfidence": 40}, + "firstName@cyr": {"scanOption": 0, "minConfidence": 40}, + "dateOfBirth": {"scanOption": 0, "minConfidence": 50}, + "placeOfBirth": {"scanOption": 1, "minConfidence": 50}, + "dateOfIssue": {"scanOption": 0, "minConfidence": 50}, + "dateOfExpiry": {"scanOption": 1, "minConfidence": 50}, + "authority": {"scanOption": 1, "minConfidence": 30}, + "documentNumber": {"scanOption": 0, "minConfidence": 40}, + "address": {"scanOption": 1}, + "address@cyr": {"scanOption": 1}, + "nationality": {"scanOption": 1}, + "nationality@cyr": {"scanOption": 1} + } + } + } + }, + "cutoutConfig" : { + "style": "animated_rect", + "maxWidthPercent": "90%", + "maxHeightPercent": "90%", + "alignment": "center", + "strokeWidth": 3, + "cornerRadius": 8, + "strokeColor": "FFFFFF", + "outerColor": "000000", + "outerAlpha": 0.3, + "ratioFromSize" : { + "width": 50, + "height": 31 + }, + "cropPadding": { + "x": -50, + "y": -50 + }, + "cropOffset": { + "x": 0, + "y": 0 + }, + "feedbackStrokeColor": "0099FF" + }, + "scanFeedback" : { + "style": "CONTOUR_RECT", + "visualFeedbackRedrawTimeout": 100, + "strokeColor": "0099FF", + "fillColor" : "220099FF", + "beepOnResult": true, + "vibrateOnResult": true, + "strokeWidth": 2 + }, + "cancelOnResult" : true + } + } + +} diff --git a/example/RNExampleApp/ios/RNExampleApp/Info.plist b/example/RNExampleApp/ios/RNExampleApp/Info.plist index e57b8d6c..c44f8c59 100644 --- a/example/RNExampleApp/ios/RNExampleApp/Info.plist +++ b/example/RNExampleApp/ios/RNExampleApp/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 33.0.0 + 34.0.0 CFBundleSignature ???? CFBundleVersion diff --git a/example/RNExampleApp/src/Overview.js b/example/RNExampleApp/src/Overview.js index 734fd4da..cbebd84b 100755 --- a/example/RNExampleApp/src/Overview.js +++ b/example/RNExampleApp/src/Overview.js @@ -117,6 +117,13 @@ export default function Overview({ updateAnyline, checkCameraPermissionAndOpen, }} /> + +