From fba81d82b8a94e139ca2fbe306896fc2750d54e0 Mon Sep 17 00:00:00 2001 From: Milan Paradina Date: Thu, 24 Oct 2024 14:31:23 +0200 Subject: [PATCH 1/4] v2.10.0 release --- .../flutter/BlinkCardFlutterPlugin.java | 46 ++++++++++------- .../ios/Classes/BlinkCardFlutterPlugin.m | 51 +++++++++++++++++-- .../lib/overlays/blinkcard_overlays.g.dart | 2 +- BlinkCard/lib/recognizer.dart | 2 +- BlinkCard/lib/recognizer.g.dart | 3 +- .../recognizers/blink_card_recognizer.g.dart | 2 +- BlinkCard/lib/types.dart | 34 +++++++++++++ BlinkCard/lib/types.g.dart | 4 +- 8 files changed, 116 insertions(+), 28 deletions(-) diff --git a/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/BlinkCardFlutterPlugin.java b/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/BlinkCardFlutterPlugin.java index a1108f0..b6c922c 100644 --- a/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/BlinkCardFlutterPlugin.java +++ b/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/BlinkCardFlutterPlugin.java @@ -35,7 +35,7 @@ import com.microblink.blinkcard.metadata.recognition.FirstSideRecognitionCallback; import com.microblink.blinkcard.recognition.RecognitionSuccessType; import com.microblink.blinkcard.view.recognition.ScanResultListener; - +import com.microblink.blinkcard.licence.exception.LicenceKeyException; import com.microblink.blinkcard.flutter.recognizers.RecognizerSerializers; import com.microblink.blinkcard.flutter.overlays.OverlaySettingsSerializers; @@ -61,7 +61,6 @@ public class BlinkCardFlutterPlugin implements FlutterPlugin, MethodCallHandler, private static final String ARG_OVERLAY_SETTINGS = "overlaySettings"; private static final String ARG_FRONT_IMAGE = "frontImage"; private static final String ARG_BACK_IMAGE = "backImage"; - private boolean mFirstSideScanned = false; private RecognizerBundle mRecognizerBundle; private RecognizerRunner mRecognizerRunner; @@ -99,27 +98,29 @@ private void setupPlugin(Context context, BinaryMessenger messenger) { @Override public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { - setLicense((Map)call.argument(ARG_LICENSE)); if (call.method.equals(METHOD_SCAN_CAMERA)) { pendingResult = result; + boolean isLicenseKeyValid = setLicense((Map)call.argument(ARG_LICENSE)); JSONObject jsonOverlaySettings = new JSONObject((Map)call.argument(ARG_OVERLAY_SETTINGS)); JSONObject jsonRecognizerCollection = new JSONObject((Map)call.argument(ARG_RECOGNIZER_COLLECTION)); - setLanguage(jsonOverlaySettings); - mRecognizerBundle = RecognizerSerializers.INSTANCE.deserializeRecognizerCollection(jsonRecognizerCollection); - UISettings uiSettings = OverlaySettingsSerializers.INSTANCE.getOverlaySettings(context, jsonOverlaySettings, mRecognizerBundle); - - startScanning(SCAN_REQ_CODE, uiSettings); - - } else if (call.method.equals(METHOD_SCAN_DIRECT_API)) { + if (isLicenseKeyValid) { + setLanguage(jsonOverlaySettings); + mRecognizerBundle = RecognizerSerializers.INSTANCE.deserializeRecognizerCollection(jsonRecognizerCollection); + UISettings uiSettings = OverlaySettingsSerializers.INSTANCE.getOverlaySettings(context, jsonOverlaySettings, mRecognizerBundle); + startScanning(SCAN_REQ_CODE, uiSettings); + } + } else if (call.method.equals(METHOD_SCAN_DIRECT_API)) { pendingResult = result; + boolean isLicenseKeyValid = setLicense((Map)call.argument(ARG_LICENSE)); JSONObject jsonRecognizerCollection = new JSONObject((Map)call.argument(ARG_RECOGNIZER_COLLECTION)); String frontImage = call.argument(ARG_FRONT_IMAGE); String backImage = call.argument(ARG_BACK_IMAGE); - - scanWithDirectApi(jsonRecognizerCollection, frontImage, backImage); + if (isLicenseKeyValid) { + scanWithDirectApi(jsonRecognizerCollection, frontImage, backImage); + } } else { result.notImplemented(); @@ -128,7 +129,8 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { @SuppressWarnings("unchecked") - private void setLicense(Map licenseMap) { + private boolean setLicense(Map licenseMap) { + boolean isLicenseKeyValid = true; if (licenseMap.get(ARG_SHOW_LICENSE_WARNING) != null) { MicroblinkSDK.setShowTrialLicenseWarning((boolean) licenseMap.get(ARG_SHOW_LICENSE_WARNING)); } else { @@ -139,12 +141,22 @@ private void setLicense(Map licenseMap) { String licensee = (String) licenseMap.get(ARG_LICENSEE); if (licensee == null) { - MicroblinkSDK.setLicenseKey(licenseKey, context); + try { + MicroblinkSDK.setLicenseKey(licenseKey, context); + } catch (LicenceKeyException licenceKeyException) { + isLicenseKeyValid = false; + pendingResult.error("Android license key error", licenceKeyException.getMessage(), null); + } } else { - MicroblinkSDK.setLicenseKey(licenseKey, licensee, context); + try { + MicroblinkSDK.setLicenseKey(licenseKey, licensee, context); + } catch (LicenceKeyException licenceKeyException) { + isLicenseKeyValid = false; + pendingResult.error("Android license key error", licenceKeyException.getMessage(), null); + } } - - MicroblinkSDK.setIntentDataTransferMode(IntentDataTransferMode.PERSISTED_OPTIMISED); + MicroblinkSDK.setIntentDataTransferMode(IntentDataTransferMode.PERSISTED_OPTIMISED); + return isLicenseKeyValid; } private void setLanguage(JSONObject jsonOverlaySettings) { diff --git a/BlinkCard/ios/Classes/BlinkCardFlutterPlugin.m b/BlinkCard/ios/Classes/BlinkCardFlutterPlugin.m index 0a3ed85..5deabb4 100644 --- a/BlinkCard/ios/Classes/BlinkCardFlutterPlugin.m +++ b/BlinkCard/ios/Classes/BlinkCardFlutterPlugin.m @@ -59,8 +59,9 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { NSDictionary *overlaySettingsDict = call.arguments[@"overlaySettings"]; NSDictionary *licenseKeyDict = call.arguments[@"license"]; - [self setLicenseKey:licenseKeyDict]; - [self scanWith:recognizerCollectionDict overlaySettingsDict:overlaySettingsDict]; + if ([self setLicenseKey:licenseKeyDict]) { + [self scanWith:recognizerCollectionDict overlaySettingsDict:overlaySettingsDict]; + } } else if ([kScanWithDirectApiMethodName isEqualToString:call.method]) { NSDictionary *recognizerCollectionDict = call.arguments[@"recognizerCollection"]; @@ -68,15 +69,17 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { self.backImageBase64String = call.arguments[@"backImage"]; NSDictionary *licenseKeyDict = call.arguments[@"license"]; - [self setLicenseKey:licenseKeyDict]; - [self scanWithDirectApi:recognizerCollectionDict frontImageString:frontImageBase64String]; + if ([self setLicenseKey:licenseKeyDict]) { + [self scanWithDirectApi:recognizerCollectionDict frontImageString:frontImageBase64String]; + } } else { result(FlutterMethodNotImplemented); } } -- (void)setLicenseKey:(NSDictionary *)licenseKeyDict { +- (BOOL)setLicenseKey:(NSDictionary *)licenseKeyDict { + __block BOOL isLicenseKeyValid = YES; licenseKeyDict = [self sanitizeDictionary:licenseKeyDict]; if ([licenseKeyDict objectForKey:@"showTrialLicenseWarning"] != nil) { @@ -88,11 +91,17 @@ - (void)setLicenseKey:(NSDictionary *)licenseKeyDict { if ([licenseKeyDict objectForKey:@"licensee"] != nil) { NSString *licensee = [licenseKeyDict objectForKey:@"licensee"]; [[MBCMicroblinkSDK sharedInstance] setLicenseKey:iosLicense andLicensee:licensee errorCallback:^(MBCLicenseError licenseError) { + self.result([FlutterError errorWithCode:@"" message:[self licenseErrorToString:licenseError] details:nil]); + isLicenseKeyValid = NO; }]; } else { [[MBCMicroblinkSDK sharedInstance] setLicenseKey:iosLicense errorCallback:^(MBCLicenseError licenseError) { + self.result([FlutterError errorWithCode:@"" message:[self licenseErrorToString:licenseError] details:nil]); + isLicenseKeyValid = NO; }]; } + + return isLicenseKeyValid; } -(void)setLanguage:(NSDictionary *)overlaySettingsDict { @@ -250,4 +259,36 @@ - (void) handleDirectApiError:(FlutterError*) flutterError { self.recognizerRunner = nil; } +- (NSString *)licenseErrorToString:(MBCLicenseError)licenseError { + switch(licenseError) { + case MBCLicenseErrorNetworkRequired: + return @"iOS license error: Network required"; + break; + case MBCLicenseErrorUnableToDoRemoteLicenceCheck: + return @"iOS license error: Unable to do remote licence check"; + break; + case MBCLicenseErrorLicenseIsLocked: + return @"iOS license error: License is locked"; + break; + case MBCLicenseErrorLicenseCheckFailed: + return @"iOS license error: License check failed"; + break; + case MBCLicenseErrorInvalidLicense: + return @"iOS license error: Invalid license"; + break; + case MBCLicenseErrorPermissionExpired: + return @"iOS license error: Permission expired"; + break; + case MBCLicenseErrorPayloadCorrupted: + return @"iOS license error: Payload corrupted"; + break; + case MBCLicenseErrorPayloadSignatureVerificationFailed: + return @"iOS license error: Payload signature verification failed"; + break; + case MBCLicenseErrorIncorrectTokenState: + return @"iOS license error: Incorrect token state"; + break; + } +} + @end \ No newline at end of file diff --git a/BlinkCard/lib/overlays/blinkcard_overlays.g.dart b/BlinkCard/lib/overlays/blinkcard_overlays.g.dart index 523b4bc..e247209 100644 --- a/BlinkCard/lib/overlays/blinkcard_overlays.g.dart +++ b/BlinkCard/lib/overlays/blinkcard_overlays.g.dart @@ -21,7 +21,7 @@ BlinkCardOverlaySettings _$BlinkCardOverlaySettingsFromJson( ..showOnboardingInfo = json['showOnboardingInfo'] as bool ..showIntroductionDialog = json['showIntroductionDialog'] as bool ..onboardingButtonTooltipDelay = - json['onboardingButtonTooltipDelay'] as int + (json['onboardingButtonTooltipDelay'] as num).toInt() ..language = json['language'] as String? ..country = json['country'] as String?; diff --git a/BlinkCard/lib/recognizer.dart b/BlinkCard/lib/recognizer.dart index 295e4c0..79f8c06 100644 --- a/BlinkCard/lib/recognizer.dart +++ b/BlinkCard/lib/recognizer.dart @@ -55,7 +55,7 @@ class RecognizerCollection { bool allowMultipleResults = false; - int milisecondsBeforeTimeout = 10000; + int milisecondsBeforeTimeout = 0; RecognizerCollection(this.recognizerArray); diff --git a/BlinkCard/lib/recognizer.g.dart b/BlinkCard/lib/recognizer.g.dart index caab07f..c751f19 100644 --- a/BlinkCard/lib/recognizer.g.dart +++ b/BlinkCard/lib/recognizer.g.dart @@ -40,7 +40,8 @@ RecognizerCollection _$RecognizerCollectionFromJson( .toList(), ) ..allowMultipleResults = json['allowMultipleResults'] as bool - ..milisecondsBeforeTimeout = json['milisecondsBeforeTimeout'] as int; + ..milisecondsBeforeTimeout = + (json['milisecondsBeforeTimeout'] as num).toInt(); Map _$RecognizerCollectionToJson( RecognizerCollection instance) => diff --git a/BlinkCard/lib/recognizers/blink_card_recognizer.g.dart b/BlinkCard/lib/recognizers/blink_card_recognizer.g.dart index b185492..6f8e66e 100644 --- a/BlinkCard/lib/recognizers/blink_card_recognizer.g.dart +++ b/BlinkCard/lib/recognizers/blink_card_recognizer.g.dart @@ -17,7 +17,7 @@ BlinkCardRecognizer _$BlinkCardRecognizerFromJson(Map json) => ..extractExpiryDate = json['extractExpiryDate'] as bool ..extractIban = json['extractIban'] as bool ..extractOwner = json['extractOwner'] as bool - ..fullDocumentImageDpi = json['fullDocumentImageDpi'] as int + ..fullDocumentImageDpi = (json['fullDocumentImageDpi'] as num).toInt() ..fullDocumentImageExtensionFactors = ImageExtensionFactors.fromJson( json['fullDocumentImageExtensionFactors'] as Map) ..handDocumentOverlapThreshold = diff --git a/BlinkCard/lib/types.dart b/BlinkCard/lib/types.dart index 4fb82d0..2724077 100644 --- a/BlinkCard/lib/types.dart +++ b/BlinkCard/lib/types.dart @@ -248,4 +248,38 @@ enum DataMatchState { Failed, /// Data match. Success +} + +/// Defines possible Android device camera video resolution preset +enum AndroidCameraResolutionPreset { + /// Will choose camera video resolution which is best for current device. + @JsonValue(0) PresetDefault, + /// Attempts to choose camera video resolution as closely as 480p. + @JsonValue(1) Preset480p, + /// Attempts to choose camera video resolution as closely as 720p. + @JsonValue(2) Preset720p, + /// Attempts to choose camera video resolution as closely as 1080p. + @JsonValue(3) Preset1080p, + /// Attempts to choose camera video resolution as closely as 2160p. + @JsonValue(4) Preset2160p, + /// Will choose max available camera video resolution. + @JsonValue(5) PresetMaxAvailable +} + +/// Define possible iOS device camera video resolution preset +enum iOSCameraResolutionPreset { + /// 480p video will always be used. + @JsonValue(0) Preset480p, + /// 720p video will always be used. + @JsonValue(1) Preset720p, + /// 1080p video will always be used. + @JsonValue(2) Preset1080p, + /// 4K video will always be used. + @JsonValue(3) Preset4K, + /// The library will calculate optimal resolution based on the use case and device used. + @JsonValue(4) PresetOptimal, + /// Device's maximal video resolution will be used. + @JsonValue(5) PresetMax, + /// Device's photo preview resolution will be used. + @JsonValue(6) PresetPhoto } \ No newline at end of file diff --git a/BlinkCard/lib/types.g.dart b/BlinkCard/lib/types.g.dart index 6580682..5c239ff 100644 --- a/BlinkCard/lib/types.g.dart +++ b/BlinkCard/lib/types.g.dart @@ -10,8 +10,8 @@ CardNumberAnonymizationSettings _$CardNumberAnonymizationSettingsFromJson( Map json) => CardNumberAnonymizationSettings() ..mode = $enumDecode(_$BlinkCardAnonymizationModeEnumMap, json['mode']) - ..prefixDigitsVisible = json['prefixDigitsVisible'] as int - ..suffixDigitsVisible = json['suffixDigitsVisible'] as int; + ..prefixDigitsVisible = (json['prefixDigitsVisible'] as num).toInt() + ..suffixDigitsVisible = (json['suffixDigitsVisible'] as num).toInt(); Map _$CardNumberAnonymizationSettingsToJson( CardNumberAnonymizationSettings instance) => From a713a1586f711666a89503d7ce754fdbf8dc2397 Mon Sep 17 00:00:00 2001 From: Milan Paradina Date: Thu, 24 Oct 2024 14:35:24 +0200 Subject: [PATCH 2/4] Update SDK version --- BlinkCard/android/build.gradle | 4 ++-- BlinkCard/ios/blinkcard_flutter.podspec | 4 ++-- BlinkCard/pubspec.yaml | 9 ++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/BlinkCard/android/build.gradle b/BlinkCard/android/build.gradle index 4c7e63c..67a9163 100644 --- a/BlinkCard/android/build.gradle +++ b/BlinkCard/android/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:8.5.0' } } @@ -39,7 +39,7 @@ android { } dependencies { - implementation('com.microblink:blinkcard:2.9.3@aar') { + implementation('com.microblink:blinkcard:2.10.0@aar') { transitive = true } } \ No newline at end of file diff --git a/BlinkCard/ios/blinkcard_flutter.podspec b/BlinkCard/ios/blinkcard_flutter.podspec index 09d6557..a24ff65 100644 --- a/BlinkCard/ios/blinkcard_flutter.podspec +++ b/BlinkCard/ios/blinkcard_flutter.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'blinkcard_flutter' - s.version = '2.9.3' + s.version = '2.10.0' s.summary = 'Flutter plugin for BlinkCard, SDK for scanning and OCR of various credit cards.' s.description = <<-DESC Flutter plugin for BlinkCard, SDK for scanning and OCR of various credit cards. @@ -18,7 +18,7 @@ Flutter plugin for BlinkCard, SDK for scanning and OCR of various credit cards. s.dependency 'Flutter' s.platform = :ios, '13.0' - s.dependency 'MBBlinkCard', '~> 2.9.1' + s.dependency 'MBBlinkCard', '~> 2.10.0' # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } diff --git a/BlinkCard/pubspec.yaml b/BlinkCard/pubspec.yaml index f85674d..14d9af8 100644 --- a/BlinkCard/pubspec.yaml +++ b/BlinkCard/pubspec.yaml @@ -1,24 +1,23 @@ name: blinkcard_flutter description: Flutter plugin for BlinkCard, SDK for scanning and OCR of various credit cards. -version: 2.9.3 +version: 2.10.0 author: Microblink homepage: https://microblink.com environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.12.0" + sdk: ">=2.12.0 <4.0.0" + flutter: "1.12.0 <3.24.2" dependencies: flutter: sdk: flutter json_annotation: ^4.1.0 - + dev_dependencies: flutter_test: sdk: flutter build_runner: ^2.3.3 json_serializable: ^6.6.1 - analyzer: ^5.11.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec From ff4df795193b47543305eaa1bdcd96dfcba16787 Mon Sep 17 00:00:00 2001 From: Milan Paradina Date: Thu, 24 Oct 2024 14:39:51 +0200 Subject: [PATCH 3/4] Update init script and license key --- initFlutterSample.sh | 15 +++++---------- sample_files/main.dart | 35 +++++++++++------------------------ 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/initFlutterSample.sh b/initFlutterSample.sh index 981b137..9ed9291 100755 --- a/initFlutterSample.sh +++ b/initFlutterSample.sh @@ -22,9 +22,6 @@ else echo "Using blinkcard_flutter from flutter pub" fi -#update sdk version to 2.12 to support null safety. -sed -in 's/sdk: ">=[0-9.]*/sdk: ">=2.12.0/' pubspec.yaml - flutter pub get # enter into android project folder @@ -58,13 +55,11 @@ popd cp ../sample_files/main.dart lib/ -#update compile and target sdk versions to 31, add android:exported="true" to manifest -sed -i '' 's#compileSdkVersion flutter.compileSdkVersion#compileSdkVersion 34#g' ./android/app/build.gradle -sed -i '' 's#targetSdkVersion flutter.targetSdkVersion#targetSdkVersion 34#g' ./android/app/build.gradle -sed -i '' 's#minSdkVersion flutter.minSdkVersion#minSdkVersion 21#g' ./android/app/build.gradle -#sed -i '' 's#android:name=".MainActivity"#android:name=".MainActivity" android:exported="true"#g' ./android/app/src/main/AndroidManifest.xml - echo "" echo "Go to Flutter project folder: cd $appName" echo "To run on Android type: flutter run" -echo "To run on iOS: go to $appName/ios and open Runner.xcworkspace; set your development team and add Privacy - Camera Usage Description & Privacy - Photo Library Usage Description keys to Runner/Info.plist file and press run" +echo "To run on iOS: +1. Open $appName/ios/Runner.xcworkspace +2. Set your development team +3. Add Privacy - Camera Usage Description & Privacy - Photo Library Usage Description keys to Runner/Info.plist file +4. Press run" diff --git a/sample_files/main.dart b/sample_files/main.dart index cb8f557..4777ebf 100644 --- a/sample_files/main.dart +++ b/sample_files/main.dart @@ -18,17 +18,10 @@ class _MyAppState extends State { String _resultString = ""; String _fullDocumentFirstImageBase64 = ""; String _fullDocumentSecondImageBase64 = ""; + String license = ""; /// BlinkCard scanning with camera Future scan() async { - String license; - if (Theme.of(context).platform == TargetPlatform.iOS) { - license = "sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUBbGV5SkRjbVZoZEdWa1QyNGlPakUzTVRJMU5qTTFNamMyT1RJc0lrTnlaV0YwWldSR2IzSWlPaUprWkdRd05qWmxaaTAxT0RJekxUUXdNRGd0T1RRNE1DMDFORFU0WWpBeFlUVTJZamdpZlE9PT1biknodonmIfXGRoRgDcJJ6XiWcxCFSE8flLOXwEKYwSUjWVAHSwI7GtA+oqJke90M+2giHY4Qqpeh67vsyoYHEyqCI8E6G47yBZxcIN/A7CFQq4IvMF4U7xaE1S4="; - } else if (Theme.of(context).platform == TargetPlatform.android) { - license = "sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUAbGV5SkRjbVZoZEdWa1QyNGlPakUzTVRVMk56VXlNRGs1TURBc0lrTnlaV0YwWldSR2IzSWlPaUprWkdRd05qWmxaaTAxT0RJekxUUXdNRGd0T1RRNE1DMDFORFU0WWpBeFlUVTJZamdpZlE9PaUxma82THp6N9XYMdWpqez318I6MV7Wnzk4WxNIv66o0TlUCNfrHmY3BS8UH7YnVV27AMw+LY1tYtZKkOrrRHKGDYLYg6noKpub5Pab7CntTLdsZ0KD/EGvkZS8j6w="; - } else { - license = ""; - } var cardRecognizer = BlinkCardRecognizer(); cardRecognizer.returnFullDocumentImage = true; @@ -59,14 +52,6 @@ class _MyAppState extends State { /// BlinkCard scanning with DirectAPI that requires both card images. /// Best used for getting the information from both front and backside information from various cards Future directApiTwoSidesScan() async { - String license; - if (Theme.of(context).platform == TargetPlatform.iOS) { - license = "sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUBbGV5SkRjbVZoZEdWa1QyNGlPakUzTVRJMU5qTTFNamMyT1RJc0lrTnlaV0YwWldSR2IzSWlPaUprWkdRd05qWmxaaTAxT0RJekxUUXdNRGd0T1RRNE1DMDFORFU0WWpBeFlUVTJZamdpZlE9PT1biknodonmIfXGRoRgDcJJ6XiWcxCFSE8flLOXwEKYwSUjWVAHSwI7GtA+oqJke90M+2giHY4Qqpeh67vsyoYHEyqCI8E6G47yBZxcIN/A7CFQq4IvMF4U7xaE1S4="; - } else if (Theme.of(context).platform == TargetPlatform.android) { - license = "sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUAbGV5SkRjbVZoZEdWa1QyNGlPakUzTVRVMk56VXlNRGs1TURBc0lrTnlaV0YwWldSR2IzSWlPaUprWkdRd05qWmxaaTAxT0RJekxUUXdNRGd0T1RRNE1DMDFORFU0WWpBeFlUVTJZamdpZlE9PaUxma82THp6N9XYMdWpqez318I6MV7Wnzk4WxNIv66o0TlUCNfrHmY3BS8UH7YnVV27AMw+LY1tYtZKkOrrRHKGDYLYg6noKpub5Pab7CntTLdsZ0KD/EGvkZS8j6w="; - } else { - license = ""; - } try { // Get images of both sides of the card with the pickMultiImage method @@ -124,14 +109,7 @@ class _MyAppState extends State { /// BlinkCard scanning with DirectAPI that requires one card image. /// Best used for cards that have all of the information on one side, or if the needed information is on one side Future directApiOneSideScan() async { - String license; - if (Theme.of(context).platform == TargetPlatform.iOS) { - license = "sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUBbGV5SkRjbVZoZEdWa1QyNGlPakUzTVRJMU5qTTFNamMyT1RJc0lrTnlaV0YwWldSR2IzSWlPaUprWkdRd05qWmxaaTAxT0RJekxUUXdNRGd0T1RRNE1DMDFORFU0WWpBeFlUVTJZamdpZlE9PT1biknodonmIfXGRoRgDcJJ6XiWcxCFSE8flLOXwEKYwSUjWVAHSwI7GtA+oqJke90M+2giHY4Qqpeh67vsyoYHEyqCI8E6G47yBZxcIN/A7CFQq4IvMF4U7xaE1S4="; - } else if (Theme.of(context).platform == TargetPlatform.android) { - license = "sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUAbGV5SkRjbVZoZEdWa1QyNGlPakUzTVRVMk56VXlNRGs1TURBc0lrTnlaV0YwWldSR2IzSWlPaUprWkdRd05qWmxaaTAxT0RJekxUUXdNRGd0T1RRNE1DMDFORFU0WWpBeFlUVTJZamdpZlE9PaUxma82THp6N9XYMdWpqez318I6MV7Wnzk4WxNIv66o0TlUCNfrHmY3BS8UH7YnVV27AMw+LY1tYtZKkOrrRHKGDYLYg6noKpub5Pab7CntTLdsZ0KD/EGvkZS8j6w="; - } else { - license = ""; - } + try { // Pick the image where the card number is located final image = await ImagePicker().pickImage(source: ImageSource.gallery); @@ -246,6 +224,15 @@ class _MyAppState extends State { @override Widget build(BuildContext context) { + + if (Theme.of(context).platform == TargetPlatform.iOS) { + license = "sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUBbGV5SkRjbVZoZEdWa1QyNGlPakUzTWprM05qQTRORFF6TWpVc0lrTnlaV0YwWldSR2IzSWlPaUprWkdRd05qWmxaaTAxT0RJekxUUXdNRGd0T1RRNE1DMDFORFU0WWpBeFlUVTJZamdpZlE9PdpgwBE8zC2bkURiApcIdb+xhoY+mB/itohh9v8my1Lb39N8IPk/HfYIvDD0m8X/cFME1JJfUJGJUetfARGfzFILLtIt9JPo+T7IalVil7FiBU1llaQFHKjUoryGrQ=="; + } else if (Theme.of(context).platform == TargetPlatform.android) { + license = "sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUAbGV5SkRjbVZoZEdWa1QyNGlPakUzTWprM05qQTRNVEk0TURjc0lrTnlaV0YwWldSR2IzSWlPaUprWkdRd05qWmxaaTAxT0RJekxUUXdNRGd0T1RRNE1DMDFORFU0WWpBeFlUVTJZamdpZlE9PfikQ/spr3JjXSCa8CyD2Ia0PMt5PMnGUb7ypnEnXO7QzwQLPl0m0Y1DavWTVjaskpeum+zMui+dHoo+5NS/5Pu25yg5Tu4jWOkXSZkYUh/XSmvVEfSG3Mr38VOZtQ=="; + } else { + license = ""; + } + Widget fullDocumentFirstImage = Container(); if (_fullDocumentFirstImageBase64 != null && _fullDocumentFirstImageBase64 != "") { From 8b80fa8e446e94fbb838b0add704760d9dfab04c Mon Sep 17 00:00:00 2001 From: Milan Paradina Date: Thu, 24 Oct 2024 14:41:33 +0200 Subject: [PATCH 4/4] Update Release notes.md --- Release notes.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Release notes.md b/Release notes.md index 0ef11ce..ec5a8a7 100644 --- a/Release notes.md +++ b/Release notes.md @@ -1,3 +1,18 @@ +## 2.10.0 + +- Updated to [Android SDK v2.10.0](https://github.com/blinkcard/blinkcard-android/releases/tag/v2.10.0) and [iOS SDK v2.10.0](https://github.com/BlinkCard/blinkcard-ios/releases/tag/v2.10.0) + +**Improvements** + +- Significant improvements in photocopy detection. + - Both the False Rejection Rate and False Acceptance Rate are reduced by ~50% as measured on the default match level. + +**Bug fixes** + +- Android specific: + - Removed `libc++_shared.so` from the SDK + - Fix for duplicate attrs resource: `attr/mb_onboardingImageColor` when combining multiple Microblink's SDKs in the same app + ## 2.9.3 ### Bug fixes