MAUI: copy regula.license to DocumentReaderSample/Resources/Raw/regula.license copy db.dat to DocumentReaderSample/Platforms/Android/Assets/Regula/db.dat and to DocumentReaderSample/Resources/Raw/db.dat
Regula Document Reader SDK allows you to read various kinds of identification documents, passports, driving licenses, ID cards, etc. All processing is performed completely offline on your device. No any data leaving your device.
You can use native camera to scan the documents or image from gallery for extract all data from it.
We have provided a simple application that demonstrates the API calls you can use to interact with the DocumentReader Library.
- Visit client.regulaforensics.com to get a trial license (
regula.license
file). The license creation wizard will guide you through the necessary steps. - Clone current repository using command
git clone https://github.com/regulaforensics/Xamarin-DocumentReader.git
. - Download and install latest Visual Studio depend on your OS.
- Copy file
regula.license
toDocumentReaderSample/Droid/Assets
orDocumentReaderSample/iOS/Resources
folder. - Copy file
db.dat
toDocumentReaderSample/Droid/Assets/Regula
orDocumentReaderSample/iOS/Resources
folder. - Launch Visual Studio and select File -> Open then select DocumentReaderSample/DocumentReaderSample.sln file in file browser.
- Download additional files proposed by Visual Studio to build project (build tools, for example).
- Select appropriate build variant and run application.
If you have issues with license verification when running the application, please verify that next is true:
- OS you are using is the same as in the license you received (Android).
- Date and time on the device you are trying to run the application is correct and inside the license validity period.
- You are using the latest release of the SDK.
- You placed the
license
into the correct folder as described here How to build demo application (DocumentReaderSample/Droid/Assets
orDocumentReaderSample/iOS/Resources
folder). - You placed the
db.dat
into the correct folder as described here How to build demo application (DocumentReaderSample/Droid/Assets/Regula
orDocumentReaderSample/iOS/Resources
folder).
You can find all available packages for Xamarin here.
To install the libraries for Android, simply open your project and install our NuGet packages named Xamarin.DocumentReader.Api.Android
and (Xamarin.DocumentReader.Core.Full.Android
or Xamarin.DocumentReader.Core.FullRfid.Android
). For more details on how to install a NuGet package, see here.
Once the libraries are installed, see our Document Reader Sample App for an example of how to use it.
- How to add DocumentReader library to your project
- Initialization Core
- Update Info.plist into your project
- Upload ipa to iTunes with SDK
To install the libraries for iOS, simply open your project and install our NuGet packages named Xamarin.DocumentReader.Api.iOS
and Xamarin.DocumentReader.Core.Full.iOS
. For more details on how to install a NuGet package, see here.
After you added libraries from NuGet to the project, make sure that you initialized Core
int the code. For example, take a look int the code below.
public partial class ViewController : UIViewController
{
....
protected ViewController(IntPtr handle) : base(handle) =>
//WARNING!!!!
//Initialization DocumentReader from DocReaderCore is required
new DocReaderCore.iOS.DocumentReader();
....
}
FYI: Xamarin is not included into ipa frameworks which are not called in the code. You can successfylly build project and run, but in runtime you will get error that DocumentReaderCore library not loaded. See error below.
dyld: Library not loaded: @rpath/DocumentReaderCore.framework/DocumentReaderCore
Don't forgot update your plist with next properties:
- Privacy - Camera Usage Description
- Privacy - Photo Library Usage Description
It's required for make a snapshot from camera or get a photo from gallery.
Because we're using Swift language for API SDK, cannot upload ipa to iTunes without next steps.
- Archive your app for Publishing.
- When the Archives window pops up, go to it in Finder (right click on it and select “Reveal in Finder”).
- When Finder appears, we need to access the archive’s content (right click and select “Show Package Contents”).
- Inside of the archive package, create a folder called “SwiftSupport”.
- Inside of the package navigate to “Product/Applications/YourAppName.app/Frameworks” (You will need to right click on the .app and select “Show Package Contents”).
- Now you should replace all “.dylib” files with files from this folder: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos. Make sure you're not replaced all the swift “.dylib” files into Frameworks directory, because iTunes would reject build.
- After that copy all the swift “.dylib” files inside of the Frameworks updated directory.
- Navigate back to “SwiftSupport” and paste those copied libraries.
- Now Launch Xcode and load Organizer (Window -> Organizer).
- Find your app in the Archives and “Upload to App Store...“.
Once the libraries are installed, see our Document Reader Sample App for an example of how to use it.