Skip to content

Commit

Permalink
Merge pull request #45 from BlinkID/release/5.3.0
Browse files Browse the repository at this point in the history
Release/5.3.0
  • Loading branch information
i1E authored Mar 19, 2020
2 parents 1153aa7 + 5796463 commit 56ec700
Show file tree
Hide file tree
Showing 68 changed files with 5,078 additions and 1,045 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,5 @@ Thumbs.db

# dotCover
*.dotCover

clean.sh
6 changes: 3 additions & 3 deletions Binding/Android/AndroidBinding.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidClassParser>class-parse</AndroidClassParser>
<PackageId>BlinkID.Android.Binding</PackageId>
<PackageVersion>5.2.0</PackageVersion>
<PackageVersion>5.3.0</PackageVersion>
<Authors>Microblink</Authors>
<Owners>Microblink</Owners>
<PackageProjectUrl>https://github.com/blinkid/blinkid-xamarin</PackageProjectUrl>
<PackageReleaseNotes>Updated to BlinkID Android SDK v5.2.0
<PackageReleaseNotes>Updated to BlinkID Android SDK v5.3.0

https://github.com/BlinkID/blinkid-android/releases/tag/v5.2.0</PackageReleaseNotes>
https://github.com/BlinkID/blinkid-android/releases/tag/v5.3.0</PackageReleaseNotes>
<Summary>A small, but powerful ID scanning library - native Android SDK binding package.</Summary>
<Title>BlinkID</Title>
<Description>A small, but powerful ID scanning library - native Android SDK binding package.</Description>
Expand Down
4 changes: 2 additions & 2 deletions Binding/Android/Jars/LibBlinkID.aar
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<PackageId>BlinkID.Forms.Android</PackageId>
<PackageVersion>5.2.0</PackageVersion>
<PackageVersion>5.3.0</PackageVersion>
<Authors>Microblink</Authors>
<Owners>Microblink</Owners>
<PackageProjectUrl>https://github.com/blinkid/blinkid-xamarin</PackageProjectUrl>
Expand All @@ -23,9 +23,9 @@
<Description>A small, but powerful ID scanning library - Android implementation for Xamarin Forms.</Description>
<ReleaseVersion>4.0.0</ReleaseVersion>
<PackOnBuild>true</PackOnBuild>
<PackageReleaseNotes>Updated for BlinkID Android SDK v5.2.0
<PackageReleaseNotes>Updated for BlinkID Android SDK v5.3.0

https://github.com/BlinkID/blinkid-android/releases/tag/v5.2.0</PackageReleaseNotes>
https://github.com/BlinkID/blinkid-android/releases/tag/v5.3.0</PackageReleaseNotes>
<!-- Workaround for build error -->
<DesignTimeBuild>false</DesignTimeBuild>
</PropertyGroup>
Expand Down Expand Up @@ -206,6 +206,7 @@ https://github.com/BlinkID/blinkid-android/releases/tag/v5.2.0</PackageReleaseNo
<Compile Include="Recognizers/Implementations/MrtdRecognizer.cs" />
<Compile Include="Recognizers/Implementations/PassportRecognizer.cs" />
<Compile Include="Recognizers/Implementations/BlinkIdCombinedRecognizer.cs" />
<Compile Include="Recognizers/Implementations/IdBarcodeRecognizer.cs" />
<Compile Include="Recognizers/Implementations/UsdlCombinedRecognizer.cs" />
<Compile Include="Recognizers/Implementations/UsdlRecognizer.cs" />
<Compile Include="Recognizers/Implementations/DocumentFaceRecognizer.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,93 @@
using Microblink.Forms.Droid.Overlays;
using Microblink.Forms.Droid.Recognizers;
using System;
using Android.Content;
using Com.Microblink.Uisettings;
using Com.Microblink.Fragment.Overlay.Blinkid.Reticleui;
using Microblink.Forms.Core.Overlays;
using Microblink.Forms.Core.Recognizers;
using Com.Microblink.Uisettings;
using Microblink.Forms.Droid.Overlays.Implementations;
using Microblink.Forms.Droid.Recognizers;
using Microblink.Forms.Droid.Overlays;

[assembly: Xamarin.Forms.Dependency(typeof(BlinkIdOverlaySettingsFactory))]
namespace Microblink.Forms.Droid.Overlays
{
public sealed class BlinkIdOverlaySettings : OverlaySettings, IBlinkIdOverlaySettings
{
public override UISettings NativeUISettings {
get {
var concreteUISettings = (BlinkIdUISettings)base.NativeUISettings;

concreteUISettings.SetDocumentDataMatchRequired(RequireDocumentSidesDataMatch);
concreteUISettings.SetShowNotSupportedDialog(ShowNotSupportedDialog);
concreteUISettings.SetBackSideScanningTimeoutMs(BackSideScanningTimeoutMilliseconds);

var overlayStringsBuilder = new ReticleOverlayStrings.Builder(Android.App.Application.Context);
if (FirstSideInstructionsText != null) {
overlayStringsBuilder.SetFirstSideInstructionsText(FirstSideInstructionsText);
}
if (FlipInstructions != null) {
overlayStringsBuilder.SetFlipInstructions(FlipInstructions);
}
if (ErrorMoveCloser != null) {
overlayStringsBuilder.SetErrorMoveCloser(ErrorMoveCloser);
}
if (ErrorMoveFarther != null) {
overlayStringsBuilder.SetErrorMoveFarther(ErrorMoveFarther);
}
if (SidesNotMatchingTitle != null) {
overlayStringsBuilder.SetSidesNotMatchingTitle(SidesNotMatchingTitle);
}
if (SidesNotMatchingMessage != null) {
overlayStringsBuilder.SetSidesNotMatchingMessage(SidesNotMatchingMessage);
}
if (UnsupportedDocumentTitle != null) {
overlayStringsBuilder.SetUnsupportedDocumentTitle(UnsupportedDocumentTitle);
}
if (UnsupportedDocumentMessage != null) {
overlayStringsBuilder.SetUnsupportedDocumentMessage(UnsupportedDocumentMessage);
}
if (RecognitionTimeoutTitle != null) {
overlayStringsBuilder.SetRecognitionTimeoutTitle(RecognitionTimeoutTitle);
}
if (RecognitionTimeoutMessage != null) {
overlayStringsBuilder.SetRecognitionTimeoutMessage(RecognitionTimeoutMessage);
}
if (RetryButtonText != null) {
overlayStringsBuilder.SetRetryButtonText(RetryButtonText);
}
concreteUISettings.SetStrings(overlayStringsBuilder.Build());
return concreteUISettings;
}
}

public string FirstSideInstructionsText { get; set; }

public string FlipInstructions { get; set; }

public string ErrorMoveCloser { get; set; }

public string ErrorMoveFarther { get; set; }

public string SidesNotMatchingTitle { get; set; }

public string SidesNotMatchingMessage { get; set; }

public string UnsupportedDocumentTitle { get; set; }

public string UnsupportedDocumentMessage { get; set; }

public string RecognitionTimeoutTitle { get; set; }

public string RecognitionTimeoutMessage { get; set; }

public string RetryButtonText { get; set; }

public bool RequireDocumentSidesDataMatch { get; set; } = true;

public bool ShowNotSupportedDialog { get; set; } = true;

public long BackSideScanningTimeoutMilliseconds { get; set; } = 17000;

public BlinkIdOverlaySettings(IRecognizerCollection recognizerCollection)
: base(new BlinkIdUISettings((recognizerCollection as RecognizerCollection).NativeRecognizerBundle), recognizerCollection)
{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ public bool AllowBlurFilter
set => nativeRecognizer.SetAllowBlurFilter(value);
}

public bool AllowUnparsedMrzResults
{
get => nativeRecognizer.ShouldAllowUnparsedMrzResults();
set => nativeRecognizer.SetAllowUnparsedMrzResults(value);
}

public bool AllowUnverifiedMrzResults
{
get => nativeRecognizer.ShouldAllowUnverifiedMrzResults();
set => nativeRecognizer.SetAllowUnverifiedMrzResults(value);
}

public uint FaceImageDpi
{
get => (uint)nativeRecognizer.FaceImageDpi;
Expand Down Expand Up @@ -79,6 +91,7 @@ internal BlinkIdCombinedRecognizerResult(Com.Microblink.Entities.Recognizers.Bli
public string Conditions => nativeResult.Conditions;
public IDate DateOfBirth => nativeResult.DateOfBirth.Date != null ? new Date(nativeResult.DateOfBirth.Date) : null;
public IDate DateOfExpiry => nativeResult.DateOfExpiry.Date != null ? new Date(nativeResult.DateOfExpiry.Date) : null;
public bool DateOfExpiryPermanent => nativeResult.IsDateOfExpiryPermanent;
public IDate DateOfIssue => nativeResult.DateOfIssue.Date != null ? new Date(nativeResult.DateOfIssue.Date) : null;
public byte[] DigitalSignature => nativeResult.GetDigitalSignature();
public uint DigitalSignatureVersion => (uint)nativeResult.DigitalSignatureVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ public bool AllowBlurFilter
set => nativeRecognizer.SetAllowBlurFilter(value);
}

public bool AllowUnparsedMrzResults
{
get => nativeRecognizer.ShouldAllowUnparsedMrzResults();
set => nativeRecognizer.SetAllowUnparsedMrzResults(value);
}

public bool AllowUnverifiedMrzResults
{
get => nativeRecognizer.ShouldAllowUnverifiedMrzResults();
set => nativeRecognizer.SetAllowUnverifiedMrzResults(value);
}

public uint FaceImageDpi
{
get => (uint)nativeRecognizer.FaceImageDpi;
Expand Down Expand Up @@ -73,6 +85,7 @@ internal BlinkIdRecognizerResult(Com.Microblink.Entities.Recognizers.Blinkid.Gen
public string Conditions => nativeResult.Conditions;
public IDate DateOfBirth => nativeResult.DateOfBirth.Date != null ? new Date(nativeResult.DateOfBirth.Date) : null;
public IDate DateOfExpiry => nativeResult.DateOfExpiry.Date != null ? new Date(nativeResult.DateOfExpiry.Date) : null;
public bool DateOfExpiryPermanent => nativeResult.IsDateOfExpiryPermanent;
public IDate DateOfIssue => nativeResult.DateOfIssue.Date != null ? new Date(nativeResult.DateOfIssue.Date) : null;
public string DocumentAdditionalNumber => nativeResult.DocumentAdditionalNumber;
public string DocumentNumber => nativeResult.DocumentNumber;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using Microblink.Forms.Droid.Recognizers;
using Microblink.Forms.Core.Recognizers;

[assembly: Xamarin.Forms.Dependency(typeof(IdBarcodeRecognizer))]
namespace Microblink.Forms.Droid.Recognizers
{
public sealed class IdBarcodeRecognizer : Recognizer, IIdBarcodeRecognizer
{
Com.Microblink.Entities.Recognizers.Blinkid.Idbarcode.IdBarcodeRecognizer nativeRecognizer;

IdBarcodeRecognizerResult result;

public IdBarcodeRecognizer() : base(new Com.Microblink.Entities.Recognizers.Blinkid.Idbarcode.IdBarcodeRecognizer())
{
nativeRecognizer = NativeRecognizer as Com.Microblink.Entities.Recognizers.Blinkid.Idbarcode.IdBarcodeRecognizer;
result = new IdBarcodeRecognizerResult(nativeRecognizer.GetResult() as Com.Microblink.Entities.Recognizers.Blinkid.Idbarcode.IdBarcodeRecognizer.Result);
}

public override IRecognizerResult BaseResult => result;

public IIdBarcodeRecognizerResult Result => result;


}

public sealed class IdBarcodeRecognizerResult : RecognizerResult, IIdBarcodeRecognizerResult
{
Com.Microblink.Entities.Recognizers.Blinkid.Idbarcode.IdBarcodeRecognizer.Result nativeResult;

internal IdBarcodeRecognizerResult(Com.Microblink.Entities.Recognizers.Blinkid.Idbarcode.IdBarcodeRecognizer.Result nativeResult) : base(nativeResult)
{
this.nativeResult = nativeResult;
}
public string AdditionalAddressInformation => nativeResult.AdditionalAddressInformation;
public string AdditionalNameInformation => nativeResult.AdditionalNameInformation;
public string Address => nativeResult.Address;
public BarcodeType BarcodeType => (BarcodeType)nativeResult.BarcodeType.Ordinal();
public IDate DateOfBirth => nativeResult.DateOfBirth.Date != null ? new Date(nativeResult.DateOfBirth.Date) : null;
public IDate DateOfExpiry => nativeResult.DateOfExpiry.Date != null ? new Date(nativeResult.DateOfExpiry.Date) : null;
public IDate DateOfIssue => nativeResult.DateOfIssue.Date != null ? new Date(nativeResult.DateOfIssue.Date) : null;
public string DocumentAdditionalNumber => nativeResult.DocumentAdditionalNumber;
public string DocumentNumber => nativeResult.DocumentNumber;
public IdBarcodeDocumentType DocumentType => (IdBarcodeDocumentType)nativeResult.DocumentType.Ordinal();
public string Employer => nativeResult.Employer;
public string FirstName => nativeResult.FirstName;
public string FullName => nativeResult.FullName;
public string IssuingAuthority => nativeResult.IssuingAuthority;
public string LastName => nativeResult.LastName;
public string MaritalStatus => nativeResult.MaritalStatus;
public string Nationality => nativeResult.Nationality;
public string PersonalIdNumber => nativeResult.PersonalIdNumber;
public string PlaceOfBirth => nativeResult.PlaceOfBirth;
public string Profession => nativeResult.Profession;
public string Race => nativeResult.Race;
public byte[] RawData => nativeResult.GetRawData();
public string Religion => nativeResult.Religion;
public string ResidentialStatus => nativeResult.ResidentialStatus;
public string Sex => nativeResult.Sex;
public string StringData => nativeResult.StringData;
public bool Uncertain => nativeResult.IsUncertain;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<TargetFramework>netstandard1.0</TargetFramework>
<PackOnBuild>true</PackOnBuild>
<PackageId>BlinkID.Forms.Core</PackageId>
<PackageVersion>5.2.0</PackageVersion>
<PackageVersion>5.3.0</PackageVersion>
<Authors>Microblink</Authors>
<Owners>Microblink</Owners>
<PackageProjectUrl>https://github.com/blinkid/blinkid-xamarin</PackageProjectUrl>
<PackageReleaseNotes>Updated for BlinkID Android and iOS SDKs v5.2.0</PackageReleaseNotes>
<PackageReleaseNotes>Updated for BlinkID Android and iOS SDKs v5.3.0</PackageReleaseNotes>
<Summary>A small, but powerful ID scanning library - abstractions library for Xamarin Forms.</Summary>
<Title>BlinkID</Title>
<Description>A small, but powerful ID scanning library - abstractions library for Xamarin Forms.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,81 @@ namespace Microblink.Forms.Core.Overlays
/// BlinkId overlay settings. This overlay is best for scanning various ID documents.
/// </summary>
public interface IBlinkIdOverlaySettings : IOverlaySettings
{}
{
/// <summary>
/// Message that is shown while scanning first side of the document.
/// If null, default value will be used.
/// </summary>
string FirstSideInstructionsText { get; set;}
/// <summary>
/// Instructions to flip the document, shown when scanning of the first side is done, before scanning the second
/// side of the document.
/// If null, default value will be used.
/// </summary>
string FlipInstructions { get; set; }
/// <summary>
/// Instructions for the user to move the document closer.
/// If null, default value will be used.
/// </summary>
string ErrorMoveCloser { get; set; }
/// <summary>
/// Instructions for the user to move the document farther.
/// If null, default value will be used.
/// </summary>
string ErrorMoveFarther { get; set; }
/// <summary>
/// Title of the dialog, which is shown when scanned document sides are not from the same document.
/// If null, default value will be used.
/// </summary>
string SidesNotMatchingTitle { get; set; }
/// <summary>
/// Message inside dialog, which is shown when scanned document sides are not from the same document.
/// If null, default value will be used.
/// </summary>
string SidesNotMatchingMessage { get; set; }
/// <summary>
/// Title of the dialog, which is shown when unsupported document is scanned.
/// If null, default value will be used.
/// </summary>
string UnsupportedDocumentTitle { get; set; }
/// <summary>
/// Message inside dialog, which is shown when unsupported document is scanned.
/// If null, default value will be used.
/// </summary>
string UnsupportedDocumentMessage { get; set; }
/// <summary>
/// Title of the dialog, which is shown on timeout when scanning is stuck on the back document side.
/// If null, default value will be used.
/// </summary>
string RecognitionTimeoutTitle { get; set; }
/// <summary>
/// Message inside dialog, which is shown on timeout when scanning is stuck on the back document side.
/// If null, default value will be used.
/// </summary>
string RecognitionTimeoutMessage { get; set; }
/// <summary>
/// Text of the "retry" button inside dialog, which is shown on timeout when scanning is stuck on the back
/// document side.
/// If null, default value will be used.
/// </summary>
string RetryButtonText { get; set; }
/// <summary>
/// If true, BlinkIdCombinedRecognizer will check if sides do match when scanning is finished.
/// Default true
/// </summary>
bool RequireDocumentSidesDataMatch { get; set; }
/// <summary>
/// Defines whether Document Not Supported dialog will be displayed in UI.
/// Default true
/// </summary>
bool ShowNotSupportedDialog { get; set; }
/// <summary>
/// Option to configure back side scanning timeout.
/// Default 17000.
/// </summary>
long BackSideScanningTimeoutMilliseconds { get; set; }

}

/// <summary>
/// BlinkId overlay settings factory. Use this to create an instance of IBlinkIdOverlaySettings.
Expand Down
Loading

0 comments on commit 56ec700

Please sign in to comment.