Flutter SDK Methods and Properties

clearActionVideos

Deletes all action videos from file system (iOS 8.4.0 and higher, Android).

Returns

Future<Void>.

getSDKVersion

Returns the SDK version.

Returns

Future<String>.

initSDK

Initializes SDK with license sources.

Parameter

Type

Description

licenses

List<String>

A list of licences

Returns

Case

Text

True

Initialization has completed successfully

False

Initialization error

setApiConnectionWithCredentials

Authentication via credentials.

Parameter

Type

Description

email

String

User email

password

String

User password

host

String

Server URL

Returns

Case

Text

Success

Nothing (void)

Failed

PlatformException:

  • code = AUTHENTICATION_FAILED

  • message = exception details

setApiConnectionWithToken

Authentication via access token.

Parameter

Type

Description

token

String

User email

host

String

Server URL

Returns

Case

Text

Success

Nothing (void)

Failed

PlatformException:

  • code = AUTHENTICATION_FAILED

  • message = exception details

setEventConnectionWithCredentials

Connection to the telemetry server via credentials.

Parameter

Type

Description

email

String

User email

password

String

User password

host

String

Server URL

Returns

Case

Text

Success

Nothing (void)

Failed

PlatformException:

  • code = AUTHENTICATION_FAILED

  • message = exception details

setEventConnectionWithToken

Connection to the telemetry server via access token.

Parameter

Type

Description

token

String

User email

host

String

Server URL

Returns

Case

Text

Success

Nothing (void)

Failed

PlatformException:

  • code = AUTHENTICATION_FAILED

  • message = exception details

isLoggedIn

Checks whether an access token exists.

Returns

Case

Returns

Token exists

True

Token does not exist

False

logout

Deletes the saved access token.

Returns

Nothing (void).

supportedLanguages

Returns the list of SDK supported languages.

Returns

List<Locale>.

executeLiveness

Starts the Liveness video capturing process.

Parameter

Type

Description

actions

Actions to execute

mainCamera

Boolean

Use main (True) or front (False) camera

Returns

List<Media>.

setSelfieLength

Sets the length of the Selfie gesture (in milliseconds).

Parameter

Type

Description

selfieLength

Int

The length of the Selfie gesture (in milliseconds). Should be within 500-5000 ms, the default length is 700

Returns

Error if any.

Analyze

Launches the analyses.

Parameter

Type

Description

analysis

List<Analysis>

The list of Analysis structures

uploadMedia

List<Media>

The list of the captures videos

params

Map<String, Any>

Additional parameters

Returns

List<RequestResult>.

setLocalization

Sets the SDK localization.

Parameter

Type

Description

locale

The SDK language

attemptSettings

The number of attempts before SDK returns error.

Parameter

Type

Description

singleCount

int

Attempts on a single action/gesture

commonCount

int

Total number of attempts on all actions/gestures if you use a sequence of them

setUICustomization

Sets the UI customization values for OzLivenessSDK. The values are described in the Customization structures section. Structures can be found in the lib\customization.dart file.

loadCustomizationResources

Loads the customized resources’ parameters from the iOS/Android customization and passes them to the Flutter aplication level.

Returns

The JSON object woth the customization resources' parameters.

setfaceAlignmentTimeout

Sets the timeout for the face alignment for actions.

Parameter

Type

Description

timeout

int

Timeout in milliseconds

Fonts and Other Customized Resources

For iOS

Add fonts and drawable resources to the application/ios project.

For Android

Fonts and images should be placed into related folders:

ozforensics_flutter_plugin\android\src\main\res\drawable ozforensics_flutter_plugin\android\src\main\res\font

The loadCustomizationResources method delivers the customization data to the Flutter application layer. This structure can be extended according to customers’ demands.

Customization structures

These are defined in the customization.dart file.

UICustomization

Contains the information about customization parameters.

ToolbarCustomization

Toolbar customization parameters.

Parameter

Type

Description

closeButtonIcon

String

Close button icon received from plugin

closeButtonColor

String

Color #XXXXXX

titleText

String

Header text

titleFont

String

Text font

titleSize

int

Font size

titleFontStyle

String

Font style

titleColor

String

Color #XXXXXX

titleAlpha

int

Header text opacity

isTitleCentered

bool

Sets the text centered

backgroundColor

String

Header background color #XXXXXX

backgroundAlpha

int

Header background opacity

CenterHintCustomization

Center hint customization parameters.

Parameter

Type

Description

textFont

String

Text font

textFontStyle

String

Font style

textColor

String

Color #XXXXXX

textSize

int

Font size

verticalPosition

int

Y position

textAlpha

int

Text opacity

centerBackground

bool

Sets the text centered

HintAnimation

Hint animation customization parameters.

Parameter

Type

Description

hideAnimation

bool

Hides the hint animation

animationIconSize

int

Animation icon size in px (40-160)

hintGradientColor

String

Color #XXXXXX

hintGradientOpacity

int

Gradient color

FaceFrameCustomization

Frame around face customization parameters.

Parameter

Type

Description

geometryType

String

Frame shape received from plugin

geometryTypeRadius

int

Corner radius for rectangle

strokeWidth

int

Frame stroke width

strokeFaceNotAlignedColor

String

Color #XXXXXX

strokeFaceAlignedColor

String

Color #XXXXXX

strokeAlpha

int

Stroke opacity

strokePadding

int

Stroke padding

VersionLabelCustomization

SDK version customization parameters.

Parameter

Type

Description

textFont

String

Text font

textFontStyle

String

Font style

textColor

String

Color #XXXXXX

textSize

int

Font size

textAlpha

int

Text opacity

BackgroundCustomization

Background customization parameters.

Parameter

Type

Description

backgroundColor

String

Color #XXXXXX

backgroundAlpha

int

Background opacity

Flutter structures

Defined in the models.dart file.

enum Locale

Stores the language information.

Case

Description

en

English

hy

Armenian

kk

Kazakh

ky

Kyrgyz

tr

Turkish

es

Spanish

pt_br

Portuguese (Brazilian)

enum MediaType

The type of media captured.

Case

Description

movement

A media with an action

documentBack

The back side of the document

documentFront

The front side of the document

enum FileType

The type of media captured.

Case

Description

documentPhoto

A photo of a document

video

A video

shotSet

A frame archive

enum MediaTag

Contains an action from the captured video.

Case

Description

blank

A video with no gesture

photoSelfie

A selfie photo

videoSelfieOneShot

A video with the best shot taken

videoSelfieScan

A video with the scanning gesture

videoSelfieEyes

A video with the blink gesture

videoSelfieSmile

A video with the smile gesture

videoSelfieHigh

A video with the lifting head up gesture

videoSelfieDown

A video with the tilting head downwards gesture

videoSelfieRight

A video with the turning head right gesture

videoSelfieLeft

A video with the turning head left gesture

photoIdPortrait

A photo from a document

photoIdBack

A photo of the back side of the document

photoIdFront

A photo of the front side of the document

Media

Stores information about media.

Parameter

Type

Description

Platform

fileType

The type of the file

Android

movement

An action on a media

iOS

mediatype

String

A type of media

iOS

videoPath

String

A path to a video

bestShotPath

String

path of the best shot in PNG for video or image path for liveness

preferredMediaPath

String

URL of the API media container

photoPath

String

A path to a photo

archivePath

String

A path to an archive

tag

A tag for media

Android

RequestResult

Stores information about the analysis result.

Parameter

Type

Description

Platform

folderId

String

The folder identifier

type

The analysis type

errorCode

int

The error code

Android only

errorMessage

String

The error message

mode

The mode of the analysis

confidenceScore

Double

The resulting score

resolution

The completed analysis' result

status

Boolean

The analysis state:

true- success;

false- failed

Analysis

Stores data about a single analysis.

Parameter

Type

Description

type

The type of the analysis

mode

The mode of the analysis

mediaList

List<Media>

Media to analyze

params

Map<String, String>

Additional analysis parameters

sizeReductionStrategy

Defines what type of media is being sent to the server in case of the hybrid analysis once the on-device analysis is finished successfully

Structures

enum Type

Analysis type.

Case

Description

biometry

The algorithm that allows comparing several media and check if the people on them are the same person or not

quality

The algorithm that aims to check whether a person in a video is a real human acting in good faith, not a fake of any kind.

enum Mode

Analysis mode.

Case

Description

onDevice

The on-device analysis with no server needed

serverBased

The server-based analysis

hybrid

The hybrid analysis for Liveness: if the score received from an on-device analysis is too high, the system initiates a server-based analysis as an additional check.

enum VerificationAction

Contains the action from the captured video.

Case

Description

oneShot

The best shot from the video taken

blank

A selfie with face alignment check

scan

Scan

headRight

Head turned right

headLeft

Head turned left

headDown

Head tilted downwards

headUp

Head lifted up

eyeBlink

Blink

smile

Smile

Resolution

The general status for all analyses applied to the folder created.

Case

Description

failed

One or more analyses failed due to some error and couldn't get finished

declined

The check failed (e.g., faces don't match or some spoofing attack detected)

success

Everything went fine, the check succeeded (e.g., faces match or liveness confirmed)

operatorRequired

The result should be additionally checked by a human operator

enum SizeReductionStrategy

Defines what type of media is being sent to the server in case of the hybrid analysis once the on-device analysis is finished successfully. By default, the system uploads the compressed video.

uploadOriginal

The original video

uploadCompressed

The compressed video

uploadBestShot

The best shot taken from the video

uploadNothing

Nothing is sent (note that no folder will be created)

Customization resources

Loaded by the loadCustomizationResources method. This is a Map to define the platform-specific resources on the plugin level.

closeButtonIcon

This key is a Map for the close button icon.

Key

Value

Close

Android drawable resource / iOS Pods resource

Arrow

Android drawable resource / iOS Pods resource

titleFont

This key is a Map containing the data on the uploaded fonts.

Key

Value

Flutter application font name

Android font resource / iOS Pods resource, used to retrieve the font on the plugin level

titleStyle

This key is a Map containing the data on the uploaded font styles.

Key

Value

Flutter application font style name

Name of the style retrieved for the font creation on the plugin level

faceFrameGeometry

This key is a Map containing the data on grame shape.

Key

Value

Oval

Oval shape

Rectangle

Rectangular shape

Last updated