myid

MyID SDK flutter plugin.

Table of contents

Android SDK: 2.4.4

iOS SDK: 2.4.5

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 not display a recommendation screen. If a certain number of unsuccessful identification attempts (currently set to 5) occur in MyID within one hour and the externalId is not empty, SDK returns to the parent app error message as message in MyIdException.

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.

Note 1.7. If the user sends a passport data to the SDK, the residency must be handled by the client. If residency = MyIdResidency.USER_DEFINED is sent, the SDK will treat the user as Non-Resident.

Note 1.8. If the SDK does not receive a passport data and receives residency = MyIdResidency.USER_DEFINED, the SDK displays the MyID passport input screen. If the user enters a PINFL, the screen will show a checkbox allowing the user to select Resident or Non-Resident.

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 flow
  • colorOnPrimary: Defines the color of text and icons shown on top of the primary color
  • colorError: Defines the color of error buttons, icons, and states
  • colorOnError: Defines the color of text and icons shown on top of error backgrounds
  • colorOutline: Defines the color of borders and outlines for inputs and cards
  • colorDivider: Defines the color of thin lines separating UI sections
  • colorSuccess: Defines the color used to show successful actions or states
  • colorButtonContainer: Defines the background color of the primary action buttons
  • colorButtonContainerDisabled: Defines the background color of disabled buttons
  • colorButtonContent: Defines the color of text/icons in primary action buttons
  • colorButtonContentDisabled: Defines the color of text/icons in disabled buttons-
  • colorScanButtonContainer: Defines the color of scan icon button
  • buttonCornerRadius: 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

You can view the full list of SDK error codes at:

👉 Error Codes Documentation

The error code in the following list may appear during the call of SDK. The list below is for your reference.

Code Error message
102 Camera access denied
103 Error while retrieving data from server or SDK
122 User banned

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.

Libraries

enums
myid
myid_config