myid 3.1.1
myid: ^3.1.1 copied to clipboard
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:
Method | Notes | Default |
---|---|---|
sessionId |
Session ID | Provided by MyID sales team. Mandatory, if using entryType = MyIdEntryType.IDENTIFICATION |
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 |
residency |
To set a specific residency type | MyIdResidency.RESIDENT |
environment |
Environment mode (Note 1.4) | MyIdEnvironment.PRODUCTION |
entryType |
Customizing the SDK entry types (Note 1.5) | MyIdEntryType.IDENTIFICATION |
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. 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 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 buttonscolorScanButtonContainer
: Defines the color of scan icon buttonbuttonCornerRadius
: 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:
The error code in the following list may appear during the call of SDK. The list below is for your reference.
Code | Error message |
---|---|
101 | User cancelled flow |
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.