Cordova SmartIDReader is a plugin for SmartEngines iOS and Android SDK which allows you to recognize identity and property rights documents while using camera.
- Add Android licence file to
<project_root>/libs/android/smartengine
- Add iOS licence file to
<project_root>/libs/ios/smartengine
- Add plugin to your project
cordova plugin add https://github.com/gordeev1/cordova-SmartIDReader
If you got the error
Unable to update build.xcconfig
when install plugin you need to do some manual steps -> see iOS manual configuration section
- Android >= 7
- IOS
SmartIDReader.recognize('ru.passport.national', '5.0').then(r => console.log(r));
{
authority: { isAccepted: true, value: "ОУФМС РОССИИ ПО НИЖЕГОРОДСКОЙ ОБЛ. В АВТОЗАВОДСКОМ Р-НЕ ГОР. НИЖНЕГО НОВГОРОДА" },
authority_code: { isAccepted: false, value: "100-001" },
birthdate: { isAccepted: true, value: "13.08.1980" },
birthplace: { isAccepted: false, value: "Г.НИЖНИЙ НОВГОРОД" },
full_mrz: { isAccepted: true, value: "PNRUSIVANOV<<IVAN<IVANOVICH<<<<<<<<<<<<<<5436776512341<<<<<<<5436776512341<45" },
gender: { isAccepted: true, value: "МУЖ." },
issue_date: { isAccepted: true, value: "06.09.2010" },
mrz_line1: { isAccepted: true, value: "PNRUSIVANOV<<IVAN<IVANOVIC<<<<<<<<<<<<<<" },
mrz_line2: { isAccepted: true, value: "1000456476RUS4563457M<<<<<<<5436776512341<45" },
name: { isAccepted: true, value: "Иван" },
number: { isAccepted: true, value: "610563" },
patronymic: { isAccepted: true, value: "Иванович" },
series: { isAccepted: true, value: "1000" },
surname: { isAccepted: false, value: "Иванов" }
}
If you see Unable to update build.xcconfig file
in the CLI output when adding the plugin you will need to configure your Xcode project manualy.
-
Open
XCode
-> Navigate toBuild Settings
tab -
Find
Header Search Paths
and add$(PROJECT_NAME)/Resources/SESmartIDCore/include
-
Find
C++ Standard Library
and selectlibc++ (LLVM C++ standard library with C++ 11 support)
- Artem Gordeev - @gordeev1