# myid MyID SDK flutter plugin. ## Table of contents - [Project adjustments](#project-adjustments) - [Usage](#usage) - [SDK error codes](#sdk-error-codes) - [Theme](#theme) Android SDK: `2.2.1` iOS SDK: `2.2.0` ## Project adjustments ### iOS Update your iOS configuration files Change `ios/Podfile` to use version 11: ```ruby platform :ios, '11.0' ``` Add descriptions for camera permission to `ios/YourProjectName/Info.plist`: ```xml NSCameraUsageDescription Required for document and facial capture ``` ## Usage ```dart var result = await MyIdClient.start( config: MyIdConfig( clientId: clientId, passportData: 'AB1234567', dateOfBirth: '01.09.1991', buildMode: MyIdBuildMode.DEBUG ), iosAppearance: MyIdIOSAppearance(), ); ``` **Parameters details**: Method | Notes | Default --- | --- | --- `passportData` | Passport serial number or PINFL data | Optional `dateOfBirth` | Date of birth in. Format: `dd.MM.yyyy` | Optional `sdkHash` | 32 characters long string | Optional `externalId` | 36 characters long. Should match with UUID4 regex | Optional `threshold` | The value can be in the range of `0.50` - `0.99` | 0.60 `buildMode` | Build mode | MyIdBuildMode.PRODUCTION `entryType` | Customizing the SDK Entry types | MyIdEntryType.AUTH `residency` | To set a specific resident type | MyIdResidentType.RESIDENT `locale` | To set a specific locale | Locale("uz") `cameraShape` | To set a specific camera shape | MyIdCameraShape.CIRCLE `resolution` | To set a specific camera resolution | MyIdResolution.RESOLUTION_480 `imageFormat` | To set a specific image format | MyIdImageFormat.PNG `organizationDetails` | Custom Organization Details | Optional `withPhoto` | Return SDK base64 | false **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](images/screen01.jpg) screen in case the sdk detects a blurry photo. **Note 1.4.** `MyIdBuildMode` contains **DEBUG** and **PRODUCTION** modes. - **DEBUG** is used to sandbox. - **PRODUCTION** is used to production. **Note 1.5.** `MyIdEntryType` contains **AUTH** and **FACE** types. - **AUTH** is used to identify the user through the MyID services. - **FACE** is used to detect a face and returns a picture (bitmap). **Note 1.6.** `MyIdCameraShape` contains **[CIRCLE](images/screen03.jpg)** and **[ELLIPSE](images/screen04.jpg)** types. ## Theme For [**Android**](https://gitlab.aigroup.uz/myid-public-code/myid-sample-android/-/blob/2.1.7/CUSTOMIZATION.md#ui-customization) For **iOS** theme config use `MyIdIOSAppearance` class and its properties. * `primaryColor`: Defines the color of SDK which guides the user through the flow * `secondaryColor`: Defines the color of the frames * `errorColor`: Defines the color of the error buttons, icons and states * `primaryButtonColor`: Defines the background color of the primary action buttons * `primaryButtonColorDisabled`: Defines the background color of the primary disabled buttons * `primaryButtonTextColor`: Defines the color of the text inside the primary action buttons * `primaryButtonTextColorDisabled`: Defines the color of the text inside the primary disabled buttons * `buttonCornerRadius`: Defines the radius dimension of all the corners of primary buttons ## 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](https://flutter.dev/developing-packages/), a specialized package that includes platform-specific implementation code for Android and/or iOS. For help getting started with Flutter, view our [online documentation](https://flutter.dev/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference.