Skip to content

Commit

Permalink
Merge pull request #127 from Anyline/feature/UTIL-66-us-lpt
Browse files Browse the repository at this point in the history
Added new example to showcase US LPT scan
  • Loading branch information
renatoAnyline authored Dec 10, 2021
2 parents dd784ab + 7d99d0d commit a27c209
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
50 changes: 50 additions & 0 deletions example/RNExampleApp/config/LicensePlateUSConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
export default {
license: 'ewogICJsaWNlbnNlS2V5VmVyc2lvbiI6IDIsCiAgImRlYnVnUmVwb3J0aW5nIjogIm9uIiwKICAiaW1hZ2VSZXBvcnRDYWNoaW5nIjogZmFsc2UsCiAgIm1ham9yVmVyc2lvbiI6ICIyNSIsCiAgIm1heERheXNOb3RSZXBvcnRlZCI6IDUsCiAgImFkdmFuY2VkQmFyY29kZSI6IHRydWUsCiAgIm11bHRpQmFyY29kZSI6IHRydWUsCiAgInN1cHBvcnRlZEJhcmNvZGVGb3JtYXRzIjogWwogICAgIkFMTCIKICBdLAogICJwaW5nUmVwb3J0aW5nIjogdHJ1ZSwKICAicGxhdGZvcm0iOiBbCiAgICAiaU9TIiwKICAgICJBbmRyb2lkIgogIF0sCiAgInNjb3BlIjogWwogICAgIkFMTCIKICBdLAogICJzaG93UG9wVXBBZnRlckV4cGlyeSI6IGZhbHNlLAogICJzaG93V2F0ZXJtYXJrIjogdHJ1ZSwKICAidG9sZXJhbmNlRGF5cyI6IDkwLAogICJ2YWxpZCI6ICIyMDIxLTEyLTMxIiwKICAiaW9zSWRlbnRpZmllciI6IFsKICAgICJjb20uYW55bGluZS5leGFtcGxlLnJlYWN0bmF0aXZlIiwKICAgICJjb20uYW55bGluZS5leGFtcGxlLnJlYWN0bmF0aXZlLmJldGEiCiAgXSwKICAiYW5kcm9pZElkZW50aWZpZXIiOiBbCiAgICAiY29tLmFueWxpbmUuZXhhbXBsZS5yZWFjdG5hdGl2ZSIKICBdCn0KekFjQVc4dmI0UjdPd0hkYkhyZkdIVlNIcVVkTzNudDd3clBPbi9XNXJkajhuK0lJSkNiRjdrSXJEOGVFVkVmU2htM2dmSzBXWnBWTGhmekFQbVRNYkU4VnU0bWVqZC9KMktCTms3d2NTa3RRbmRYUko2V2RuTmxMZS9uUFNSM1RvWXdQMVU3WG0zb01MVGErdFNRaElubDlvZXhYUkFMT25ZM1J5OUY0d0lKcUxMeUMxcmVieXFMcDJwRGx6N3RCeHNkd2ZLZEx3TkQrQWtJUGxKQmNrbUlGN2lIREJLOW55aVNCMXJPMUxET2VEOUJZMlNZU0UwelR1Z2I1bzN2UG9kenYxYldhVmpMS05vcGw1QVNGU3BKcjdNZE9oN2hvMW5rcGk4Rm5uVFJCUko4QklSb2dGRmI4SUQxOXdvdlk3M1BqMGI2dkdabGxucElDTm1UNnFBPT0=',
options: {
"camera": {
"captureResolution": "1080p",
"zoomGesture": true
},
"flash": {
"mode": "manual",
"alignment": "top_left"
},
"viewPlugin": {
"plugin": {
"id": "LICENSE_PLATE_US",
"licensePlatePlugin": {
"scanMode": "unitedStates"
},
"delayStartScanTime": 1000
},
"cutoutConfig": {
"style": "rect",
"maxWidthPercent": "80%",
"maxHeightPercent": "80%",
"alignment": "top_half",
"width": 720,
"ratioFromSize": {
"width": 2,
"height": 1
},
"strokeWidth": 2,
"cornerRadius": 10,
"strokeColor": "FFFFFF",
"outerColor": "000000",
"outerAlpha": 0.3,
"feedbackStrokeColor": "0099FF"
},
"scanFeedback": {
"animationDuration": 0,
"style": "RECT",
"strokeWidth": 2,
"strokeColor": "0099FF",
"blinkOnResult": true,
"beepOnResult": true,
"vibrateOnResult": true
},
"cancelOnResult": true,
"delayStartScanTime": 2000
}
},
}
8 changes: 8 additions & 0 deletions example/RNExampleApp/src/Overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ export default function Overview({ updateAnyline, checkCameraPermissionAndOpen,
platformPermissionCheck('LICENSE_PLATE')
}} />
</View>
<View style={styles.buttons}>
<Button style={styles.buttons} title={' US License Plate Scanner'} color="#0099FF"
disabled={disabled}
onPress={() => {
platformPermissionCheck('LICENSE_PLATE_US')
}} />
</View>

<View style={styles.buttons}>
<Button style={styles.buttons} title={' Universal TIN Scanner'} color="#0099FF"
disabled={disabled}
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 @@ -32,6 +32,7 @@ import IBANConfig from '../config/IbanConfig';
import VoucherConfig from '../config/VoucherConfig';
import DrivingLicenseConfig from '../config/DrivingLicenseConfig';
import LicensePlateConfig from '../config/LicensePlateConfig';
import LicensePlateUSConfig from '../config/LicensePlateUSConfig';
import SerialNumberConfig from '../config/SerialNumber';
import VinConfig from '../config/VINConfig';
import USNRConfig from '../config/USNRConfig';
Expand Down Expand Up @@ -178,6 +179,9 @@ class Anyline extends Component {
case 'LICENSE_PLATE':
config = LicensePlateConfig;
break;
case 'LICENSE_PLATE_US':
config = LicensePlateUSConfig;
break;
case 'DOCUMENT':
config = DocumentConfig;
break;
Expand Down
1 change: 1 addition & 0 deletions plugin/ios/ALPluginHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ + (NSDictionary *)dictionaryForLicensePlateResult:(ALLicensePlateResult *)scanRe
//Create the result Object
NSMutableDictionary *dictResult = [NSMutableDictionary dictionaryWithCapacity:5];
[dictResult setValue:scanResult.country forKey:@"country"];
[dictResult setValue:scanResult.area forKey:@"area"];
[dictResult setValue:scanResult.result forKey:@"licensePlate"];
[dictResult setValue:[ALPluginHelper stringForOutline:outline] forKey:@"outline"];
[dictResult setValue:@(scanResult.confidence) forKey:@"confidence"];
Expand Down
2 changes: 1 addition & 1 deletion plugin/ios/AnylineSDKPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ - (ALScanMode)energyScanModeFromString:(NSString *)scanMode{

- (BOOL)scanModeIndex:(NSString *)scanMode{

NSArray *possibleScanModes = @[@"DOCUMENT", @"MRZ", @"BARCODE", @"LICENSE_PLATE", @"ANYLINE_OCR", @"ANALOG_METER", @"DIGITAL_METER", @"AUTO_ANALOG_DIGITAL_METER",
NSArray *possibleScanModes = @[@"DOCUMENT", @"MRZ", @"BARCODE", @"LICENSE_PLATE", @"LICENSE_PLATE_US", @"ANYLINE_OCR", @"ANALOG_METER", @"DIGITAL_METER", @"AUTO_ANALOG_DIGITAL_METER",
@"DIAL_METER", @"SERIAL_NUMBER", @"HEAT_METER_4", @"HEAT_METER_5", @"HEAT_METER_6", @"DOT_MATRIX_METER"];

return [possibleScanModes containsObject: [scanMode uppercaseString]];
Expand Down

0 comments on commit a27c209

Please sign in to comment.