myid 3.1.1

SDKflutter
Platformandroidios

MyID SDK plugin for Flutter. Package supports iOS and Android to verify users identity.

myid

MyID SDK flutter plugin.

Table of contents

Android SDK: 3.1.1

iOS SDK: 3.1.1

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(
        sessionId: sessionId,
        clientHash: clientHash,
        clientHashId: clientHashId,
        environment: MyIdEnvironment.PRODUCTION
    ),
    iosAppearance: MyIdIOSAppearance(),
);

Parameters details:

MethodNotesDefault
sessionIdSession IDProvided by MyID sales team. Mandatory, if using entryType = MyIdEntryType.IDENTIFICATION
clientHashClient HashProvided by MyID sales team. Mandatory, if using entryType = MyIdEntryType.IDENTIFICATION
clientHashIdClient Hash IDProvided by MyID sales team. Mandatory, if using entryType = MyIdEntryType.IDENTIFICATION
residencyTo set a specific residency typeMyIdResidency.RESIDENT
environmentEnvironment mode (Note 1.4)MyIdEnvironment.PRODUCTION
entryTypeCustomizing the SDK entry types (Note 1.5)MyIdEntryType.IDENTIFICATION
localeTo set a specific localeMyIdLocale.UZBEK
cameraShapeTo set a specific camera shapeMyIdCameraShape.CIRCLE
cameraResolutionTo set a specific camera resolutionMyIdCameraResolution.LOW
imageFormatTo set a specific image formatMyIdImageFormat.PNG
organizationDetailsCustom Organization DetailsOptional

Note 1.1. MyIdEnvironment contains DEBUG and PRODUCTION modes.

  • DEBUG is used to sandbox.
  • PRODUCTION is used to production.

Note 1.2. 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.3. MyIdCameraShape contains CIRCLE and ELLIPSE types.

Note 1.4. 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.5. 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.

CodeError message
101User cancelled flow
102Camera access denied
103Error while retrieving data from server or SDK
122User 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.