myid
MyID SDK flutter plugin.
Table of contents
Android SDK: 2.4.1
iOS SDK: 2.3.7
Project adjustments
iOS
Update your iOS configuration files
Change ios/Podfile
to use version 13:
platform :ios, '13.0'
Add descriptions for camera permission to ios/YourProjectName/Info.plist
:
<plist version="1.0">
<dict>
<!-- Add these two elements: -->
<key>NSCameraUsageDescription</key>
<string>Required for document and facial capture</string>
<!-- ... -->
</dict>
</plist>
Usage
var result = await MyIdClient.start(
config: MyIdConfig(
clientId: clientId,
clientHash: clientHash,
clientHashId: clientHashId,
passportData: 'AB1234567',
dateOfBirth: '01.09.1991',
environment: MyIdEnvironment.PRODUCTION
),
iosAppearance: MyIdIOSAppearance(),
);
Parameters details:
Method | Notes | Default |
---|---|---|
clientHash |
Client Hash | Provided by MyID sales team. Mandatory, if using entryType = MyIdEntryType.IDENTIFICATION |
clientHashId |
Client Hash ID | Provided by MyID sales team. Mandatory, if using entryType = MyIdEntryType.IDENTIFICATION |
passportData |
Passport serial number or PINFL data | Optional |
dateOfBirth |
Date of birth in. Format: dd.MM.yyyy |
Optional |
sdkHash |
32 characters long string (Note 1.2) | Optional |
externalId |
36 characters long. Should match with UUID4 regex (Note 1.3) | Optional |
threshold |
The value can be in the range of 0.55 - 0.99 |
0.55 |
environment |
Environment mode (Note 1.4) | MyIdEnvironment.PRODUCTION |
entryType |
Customizing the SDK entry types (Note 1.5) | MyIdEntryType.IDENTIFICATION |
residency |
To set a specific residency type | MyIdResidency.RESIDENT |
locale |
To set a specific locale | MyIdLocale.UZBEK |
cameraShape |
To set a specific camera shape | MyIdCameraShape.CIRCLE |
cameraResolution |
To set a specific camera resolution | MyIdCameraResolution.LOW |
imageFormat |
To set a specific image format | MyIdImageFormat.PNG |
organizationDetails |
Custom Organization Details | Optional |
Note 1.1. You can customize the screen for entering passport data and date of birth in your application, in which case you can pass these parameters during initialization to the SDK, otherwise the SDK requires the input of passport data and date of birth for user identification.
Note 1.2. If the sdk_hash
is empty, blank or string with length other than 32 has been
provided, we will continue showing the credentials screen.
Note 1.3. If the externalId
is not empty, has a length of 36 characters and corresponds to the
regular expression UUID4, we will display a recommendation screen in case the
sdk detects a blurry photo.
Note 1.4. MyIdEnvironment
contains DEBUG and PRODUCTION modes.
- DEBUG is used to sandbox.
- PRODUCTION is used to production.
Note 1.5. MyIdEntryType
contains IDENTIFICATION and FACE_DETECTION types.
- IDENTIFICATION is used to identify the user through the MyID services.
- FACE_DETECTION is used to detect a face and returns a picture (bitmap).
Note 1.6. MyIdCameraShape
contains CIRCLE
and ELLIPSE types.
Theme
For Android
For iOS theme config use MyIdIOSAppearance
class and its properties.
colorPrimary
: Defines the color of SDK which guides the user through the flowcolorOnPrimary
: Defines the color of text and icons shown on top of the primary colorcolorError
: Defines the color of error buttons, icons, and statescolorOnError
: Defines the color of text and icons shown on top of error backgroundscolorOutline
: Defines the color of borders and outlines for inputs and cardscolorDivider
: Defines the color of thin lines separating UI sectionscolorSuccess
: Defines the color used to show successful actions or statescolorButtonContainer
: Defines the background color of the primary action buttonscolorButtonContainerDisabled
: Defines the background color of disabled buttonscolorButtonContent
: Defines the color of text/icons in primary action buttonscolorButtonContentDisabled
: Defines the color of text/icons in disabled buttonsbuttonCornerRadius
: Defines the corner radius of all primary buttons
Custom Organization Details
You can customize the SDK, for it to match your organization's brand book, by
providing MyIdOrganizationDetails
object to organizationDetails
method. The object allows you to
customize following fields:
- phoneNumber - by default 712022202, which is MyID's call center. If you would like the customer to call your own call center, you can display your own phone number on the error screen, by providing it in this field (sample).
- logo - the image drawable name, that will be displayed on the input screen. If you would like to display your own logo on the top of the screen, this is the place to provide it. Make sure it fits the imageView element, which has the 240x60 size.
SDK error codes
The error code in the following list may appear during the call of SDK. The list below is for your reference.
Code | Error message |
---|---|
2 | Паспортные данные введены неправильно |
3 | Не удалось подтвердить жизненность |
4 | Не удалось распознать |
5 | Внешний сервис недоступен или работает некорректно |
6 | Запрашиваемый пользовател скончался |
7 | Фото с ресурсов не получено |
8 | Внутренняя ошибка MyID |
9 | Срок выполнения задачи истек |
10 | Срок ожидания задачи в очереди истек |
11 | Сервис MyID не может обработать запрос. Попробуйте повторить позже |
12 | Сервис MyID не может обработать запрос. Попробуйте повторить позже |
13 | Сервис MyID не может обработать запрос. Попробуйте повторить позже |
14 | Не удалось подтвердить жизненность. Некорректная фотография |
15 | Сервис MyID не может обработать запрос. Попробуйте повторить позже |
16 | Сервис MyID не может обработать запрос. Попробуйте повторить позже |
17 | Не удалось распознать. Некорректная фотография |
18 | Сервис проверки жизненности не может обработать запрос |
19 | Сервис распознования не может обработать запрос |
20 | Размытая фотография |
21 | Лицо не полностью изображено |
22 | Обнаружено несколько лиц |
23 | Представленное изображение в градациях серого, требуется цветное изображение |
24 | Обнаружены затемненные очки |
25 | Тип фотографии не поддерживается |
26 | Глаза закрыты либо не видны |
27 | Обнаружено вращение головы |
28 | Не удалось обнаружить все ориентиры |
101 | Непредвиденная ошибка |
102 | Доступ к камере запрещен |
103 | Ошибка при получении данных с сервера |
120 | Размытое фото обнаружено в SDK |
Getting Started with Flutter plugins
This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.