Skip to content

Commit

Permalink
Merge pull request #117 from Anyline/release/34
Browse files Browse the repository at this point in the history
Release/34
  • Loading branch information
renatoAnyline authored Oct 7, 2021
2 parents 58f01e8 + 31f26f2 commit 542ab9c
Show file tree
Hide file tree
Showing 12 changed files with 142 additions and 21 deletions.
3 changes: 2 additions & 1 deletion example/RNExampleApp/config/ArabicIdConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default {
"plugin":{
"id":"ID",
"idPlugin": {
"arabicIdConfig": {
"universalIdConfig": {
"alphabet" : "arabic",
"faceDetection": true,
"allowedLayouts": {
"mrz": [],
Expand Down
98 changes: 98 additions & 0 deletions example/RNExampleApp/config/CyrillicIdConfig.js
Original file line number Diff line number Diff line change
@@ -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
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp-resources.sh",
"${PODS_ROOT}/Anyline/AnylineSDK_iOS_32/Framework/AnylineResources.bundle",
"${PODS_ROOT}/Anyline/AnylineSDK_iOS_34/Framework/AnylineResources.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
);
name = "[CP] Copy Pods Resources";
Expand Down
2 changes: 1 addition & 1 deletion example/RNExampleApp/ios/RNExampleApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>33.0.0</string>
<string>34.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion example/RNExampleApp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "RNExampleApp",
"version": "33.0.0",
"version": "34.0.0",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
Expand Down
7 changes: 7 additions & 0 deletions example/RNExampleApp/src/Overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ export default function Overview({ updateAnyline, checkCameraPermissionAndOpen,
}} />
</View>

<View style={styles.buttons}>
<Button style={styles.buttons} title={' Cyrillic Id'} color="#0099FF"
disabled={disabled}
onPress={() => {
platformPermissionCheck('CYRILLIC_ID')
}} />
</View>

<Text style={styles.text}>VEHICLE</Text>

Expand Down
4 changes: 4 additions & 0 deletions example/RNExampleApp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import DocumentConfig from '../config/DocumentConfig';
import MRZConfig from '../config/MRZConfig';
import UniversalIdConfig from '../config/UniversalIdConfig';
import ArabicIdConfig from '../config/ArabicIdConfig';
import CyrillicIdConfig from '../config/CyrillicIdConfig';
import NFCAndMRZConfig from '../config/NFCAndMRZConfig';
import AutoEnergyConfig from '../config/AutoEnergyConfig';
import AnalogEnergyConfig from '../config/AnalogMeterConfig';
Expand Down Expand Up @@ -165,6 +166,9 @@ class Anyline extends Component {
case 'ARABIC_ID':
config = ArabicIdConfig;
break;
case 'CYRILLIC_ID':
config = CyrillicIdConfig;
break;
case 'NFC+MRZ':
config = NFCAndMRZConfig;
break;
Expand Down
11 changes: 11 additions & 0 deletions plugin/android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
2 changes: 1 addition & 1 deletion plugin/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ repositories {

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'io.anyline:anylinesdk:33.0.0'
implementation 'io.anyline:anylinesdk:34.0.0'
implementation "com.facebook.react:react-native:+" // from node_modules
implementation("com.google.android.material:material:1.4.0-rc01")
implementation 'androidx.multidex:multidex:2.0.1'
Expand Down
2 changes: 1 addition & 1 deletion plugin/ios/AnylineReact.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/Anyline/anyline-ocr-react-native-module.git", :tag => "#{s.version}" }

s.source_files = "*.{h,m}"
s.dependency "Anyline", "~> 33"
s.dependency "Anyline", "~> 34"
s.dependency "React"
end
14 changes: 7 additions & 7 deletions plugin/ios/AnylineSDKPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"];

Expand All @@ -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];
}

Expand Down Expand Up @@ -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];
}

Expand All @@ -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];
}

Expand Down
16 changes: 8 additions & 8 deletions plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"_from": "anyline-ocr-react-native-module@^33.0.0",
"_id": "anyline-ocr-react-native-module@33.0.0",
"_from": "anyline-ocr-react-native-module@^34.0.0",
"_id": "anyline-ocr-react-native-module@34.0.0",
"_inBundle": false,
"_integrity": "sha512-BGi9zNkSsoxXywDBIqzgBRvKUBniQOJHDKBrozZubKthZNRBAj8Ry5tW0Me0yLXt/fauME//hbC0wsenfPJZqw==",
"_location": "/anyline-ocr-react-native-module",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "anyline-ocr-react-native-module@^33.0.0",
"raw": "anyline-ocr-react-native-module@^34.0.0",
"name": "anyline-ocr-react-native-module",
"escapedName": "anyline-ocr-react-native-module",
"rawSpec": "^33.0.0",
"rawSpec": "^34.0.0",
"saveSpec": null,
"fetchSpec": "^33.0.0"
"fetchSpec": "^34.0.0"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-33.0.0.tgz",
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-34.0.0.tgz",
"_shasum": "62ab2a6c30e365851e5c6951546576a711d9183e",
"_spec": "anyline-ocr-react-native-module@^33.0.0",
"_spec": "anyline-ocr-react-native-module@^34.0.0",
"_where": "/Users/amiransari/Projects/anyline-ocr-react-native-module1/example/RNExampleApp",
"bugs": {
"url": "https://github.com/Anyline/anyline-ocr-react-native-module/issues"
Expand All @@ -47,5 +47,5 @@
"type": "git",
"url": "git+https://github.com/Anyline/anyline-ocr-react-native-module.git"
},
"version": "33.0.0"
"version": "34.0.0"
}

0 comments on commit 542ab9c

Please sign in to comment.