Enhance your Xamarin cross-platform apps with an AI-driven mobile ID scanning software.
Please note that, for maximum performance and full access to all features, it’s best to go with one of our native SDKs (for iOS or Android).
Below you can try out our sample app, read the integration guides for both Android and iOS and study advanced topics ⬇️
Steps for integrating BlinkID into your Xamarin Forms project:
Core
, Droid
and iOS
projects, add BlinkID.Forms
NuGet package as a reference.Droid
project, update your MainActivity.cs
in a following way:
MainActivity
class so that it implements BlinkID.Forms.Droid.IMicroblinkScannerAndroidHostActivity
. This interface specifies 2 properties and 1 method that you must implement:
HostActivity
property must return reference to current host activity.ScanActivityRequestCode
property must return integer that will be used as request code for Android's StartActivityForResult
invocationScanningStarted
method will be called just before scanning starts. It will receive currently used MicroblinkScannerImplementation
as a parameter. You should save a reference to this object because you will need it later in your implementation of OnActivityResult
Activity's
method OnActivityResult
and pass its parameters to reference of MicroblinkScannerImplementation
iOS
project does not need any modifications.Core
project, obtain a reference to IMicroblinkScannerFactory
using a DependencyService
IMicroblinkScanner
.Messages.ScanningDoneMessage
that will inform you whether the scanning has completed or was cancelled by end userIRecognizerCollection
using IRecognizerCollectionFactory
obtained via DependencyService
Scan
on instance of IMicroblinkScanner
Xamarin Forms sample app is available here.
In your native Android project, add reference to BlinkID.Android.Binding
NuGet package and follow the integration instructions for BlinkID Android SDK.
Native Android sample app is available here.
In your native iOS project, add reference to BlinkID.iOS.Binding
NuGet package and follow the integration instructions for BlinkID iOS SDK.
Native iOS sample app is available here.
If you do not wish to use BlinkID NuGet packages, you can directly reference binding projects in your solutions. Just make sure that following conditions are met:
git lfs pull
command.Binding
- Xamarin iOS and Android Binding Libraries and Xamarin Forms project from which all mentioned NuGet packages were builtSamples
- Xamarin.iOS, Xamarin.Android and Xamarin.Forms sample applicationsBinding/Android/Jars/LibBlindID.aar
with latest AARBinding/Forms/BlinkID.Forms/BlinkID.Forms.sln
solutionTransforms/Metadata.xml
in AndroidBinding
project.AndroidBinding
project, select Options
, under NuGet Package
section select Metadata
Version
on tab General
Release notes
on tab Details
AndroidBinding
projectBinding/iOS/MicroBlink.bundle
and Binding/iOS/MicroBlink.framework
with latest versionsGenerate new ApiDefinitions.cs
and StructsAndEnums.cs
with latest version of Objective Sharpie, but DO NOT OVERWRITE existing ApiDefiniton.cs
and Structs.cs
ApiDefinitions.cs
and StructsAndEnums.cs
with following command (replace iphoneos11.4
with latest SDK you have on your Mac):cd Binding/iOS
sharpie bind -sdk iphoneos11.4 MicroBlink.framework/Headers/MicroBlink.h -scope MicroBlink.framework/Headers -namespace Microblink -c -F .
StructsAndEnums.cs
into existing Structs.cs
while fixing compile errors
sharpie
generates enums with underlying types such as nuint
or nint
which are not supported by latest version of C# - you must replace those with uint
or int
types.ApiDefinitions.cs
into existing ApiDefinition.cs
ApiDefinition.cs
has been manually edited to ensure correct compilation and correct exposure of all native SDK features. Focus only on adding new recognizers and parsers. Usually it shuold not be necessary to add other classes.Binding/Forms/BlinkID.Forms/BlinkID.Forms.sln
solutioniOSBinding
project remove MicroBlink.bundle
and re-add it back
MicroBlink.bundle
have BuildAction
set to BundleResource
iOSBinding
project, select Options
, under NuGet Package
section select Metadata
Version
on tab General
Release notes
on tab Details
iOSBinding
project and fix any compile errors that may have been introduced in steps 4. and 5.Binding/Forms/BlinkID.Forms/BlinkID.Forms.sln
solutionBlinkID.Forms.Core
project, select Options
, under NuGet Package
section select Metadata
Version
on tab General
Release notes
on tab Details
BlinkID.Forms.Android
, BlinkID.Forms.iOS
and BlinkID.Forms.NuGet
projectsBlinkID.Forms.Core
add interfaces for new functionality (e.g. new recognizer)BlinkID.Forms.Android
and BlinkID.Forms.iOS
projectsBlinkID.Forms.Core
, BlinkID.Forms.Android
and BlinkID.Forms.iOS
projectsBinding/Forms/BlinkID.Forms/BlinkID.Forms.sln
solutionRelease
build type is selected in Visual Studio
BlinkID.Forms.NuGet
project and select Create NuGet package
bin/Release
folderThis section describes how to create your scan activity with BlinkID SDK, natively in Android and wrap it to Xamarin. For that purpose, we have prepared AndroidCustomUI sample.
Steps to wrap custom functionality to Xamarin:
LibBlinkIDWrapper-release.aar
from our Android library moduleBlinkID.Android.Binding
nuget package.aar
to Jars
folder and set the Build Action for .aar
to LibraryProjectZipBlinkID.Android.Binding