Innov8tif EMAS EKYC APIs
  • EMAS eKYC API
  • Innov8tif EMAS eKYC APIs Process Flow
  • OkayID
    • OkayID - Overall
    • OCR
      • Change Log
      • Version 3
      • Version 2
      • Version 1
    • Get Document Type
    • Document Type
      • Brunei
      • Cambodia
      • Indonesia
      • Malaysia
      • Myanmar
      • Philippines
      • Singapore
      • Thailand
      • United Arab Emirates
      • Vietnam
    • Field Type Reference
      • FieldType List
      • Brunei
      • Cambodia
      • Indonesia
      • Malaysia
      • Myanmar
      • Philippines
      • Singapore
      • Thailand
      • United Arab Emirates
      • Vietnam
      • Passport
    • Error List
    • Image Requirements
  • OkayID Lite
    • Indonesia
      • Version 1
    • Malaysia
      • Version 1
    • Thailand
      • Version 1
    • OCR(Non-Roman Character)
      • Version 1
    • Image Requirements
  • OKAYID LITE - MOBILE SDK
    • Getting Started with OkayID Lite
    • Installation Guide
    • Development
    • Changelog
  • OkayLive++
    • Anti-spoofing
  • OkayLive
    • Anti-spoofing
      • Change Log
      • Version 1
  • OkayFace
    • OkayFace - Overall
    • Face Verification
      • Version 1
    • 1:1 Face Verification V2
      • Change Log
    • 1:1 Face Verification V3
      • Change Log
    • 1:1 Face Verification V4
      • Change Log
    • 1:1 Face Verification V2-1
      • Change Log
    • 1:1 Face Verification V2-2
      • Change Log
    • 1:1 Face Verification V3-1
      • Change Log
    • 1:1 Face Verification V4-1
      • Change Log
    • Image Requirements
    • Error List
    • Face Search [BETA TESTING]
      • Face Insert
      • Face Query
      • Change Log
  • Face Detector - Mobile SDK
  • Getting Started with Face Detector
  • Installation Guide
  • Development
  • Changelog
    • Android
    • iOS
    • React-Native
  • OkayDoc
    • OkayDoc - Overall
    • Brunei
      • BN - Domestic ID Card
        • Change Log
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • BN - Permanent ID Card
        • Change Log
        • Version 1
        • Recommended Threshold And Sample for Landmarks
    • Cambodia
      • KH - ID Card Front
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • KH - ID Card Back
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
    • Indonesia
      • IDN - e-KTP Front
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • IDN - e-KTP Back
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
    • Malaysia
      • MYS - MyKad Front
        • Change Log
        • Version 7
        • Version 6
        • Version 5.1(Deprecated)
        • Version 5(Deprecated)
        • Version 3(Deprecated)
        • Recommended Threshold And Sample for Landmarks
        • holoFace and idFace Samples
      • MYS - MyKad Back
        • Change Log
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • MYS - MyKas
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • MYS - MyPR
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • MYS - MyTentera
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • MYS - Driving License
        • Change Log
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • MYS - MyOKU(beta)
        • Change Log
        • Version 1
        • Recommended Threshold And Sample for Landmarks
    • Myanmar
      • MM - Driving License
        • Change Log
        • Version 1
        • Recommended Threshold And Sample for Landmarks
    • Philippines
      • PH - Driving License
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • PH - SSS
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • PH - PRC Professional ID Card
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • PH - UMID
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • PH - Voter ID
        • Change Log
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • PH - Postal ID
        • Change Log
        • Version 1
        • Recommended Threshold And Sample for Landmarks
    • Singapore
      • SG - NRIC Front
        • Change Log
        • Version 2-1
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • SG - NRIC Back
        • Change Log
        • Version 1
        • Recommended Threshold And Sample for Landmarks
    • Thailand
      • TH - ID Card
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
    • United Arab Emirates
      • UAE - ID Card
        • Change Log
        • Version 1
        • Recommended Threshold And Sample for Landmarks
    • Vietnam
      • VN - Old ID Card
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
      • VN - New ID Card
        • Change Log
        • Version 2
        • Version 1
        • Recommended Threshold And Sample for Landmarks
    • Non Passport
      • Change Log
      • Version 1
    • Passport
      • Change Log
      • Version 3
      • Version 2
      • Version 1
      • Recommended Threshold for Landmarks
      • Landmarks checked for Passport
      • Half-sized and Full-sized Passport Image Samples
    • Data Consistency Check
      • Version 1
      • Passport MRZ-Visual Consistency Check and MRZ Validity
    • Error List
    • Supported Documents and Check Type
    • Image Requirements
  • OkayDoc - Mobile SDK
    • Getting Started with OkayDoc
    • Installation Guide
    • Development
    • Changelog
  • OkayCam - Mobile SDK
    • Getting Started with OkayCam
    • Installation Guide
    • Development (Document Capture)
    • Development (Face Capture)
    • Error/Exception Handling
    • Changelog
      • Android
      • iOS
      • React-Native
  • OkayDB
    • OkayDB -Overall
    • AML
      • Search Business
        • Version 1
      • Search By BusinessID
        • Version 1
      • Search Person
        • Version 1
      • Search By Person ID
        • Version 1
      • Save Result as PDF
        • Version 1
      • Postman Collection
    • Indonesia
      • e-KTP Check
        • Version 1
    • Malaysia
      • Information Check
        • Version 3
        • Version 2
        • Version 1
    • Vietnam
      • Driver License Check
        • Version 1
  • Other
    • OkayID Web Camera
      • HTML Media Capture - Upload Approach
      • Web RTC - High Resolution
      • Web RTC - Screen Capture
      • Operating System Detection
    • OkayLive Web Camera
    • IDV App URL
    • ID Collection Application
    • FAQ
  • Other API
    • Get Details by ID
    • Fake ID Detection
  • EMAS eKYC Portal
    • Create JourneyID
    • Centralized OkayID
    • Centralized OkayFace
    • Centralized OkayFace(v1-1)
    • Centralized OkayLive
    • Centralized OkayDoc
      • Non-passport
      • Passport
    • Get Scorecard Result
    • Get Scorecard Config
    • Postman Collection
    • Error List
Powered by GitBook
On this page

Was this helpful?

Development

This page contains the information of Usage, Configuration, Result of OkayDoc for Android and iOS

Usage

For Android, a valid license key is required to start the process.

Configuration

Build the configuration object with the following Config properties listed below:

Config

Possible Input Range

Default

path

String

null

faceThreshold

between 0.0 and 1.0

0.9

eyeThreshold

between 0.0 and 1.0

0.5

Config config = new Config.Builder()
                .setImagePath(imagePath)
                .setFaceThreshold(0.9f)
                .setEyeThreshold(0.5f)
                .build();

SDK Initialization

Start the process by calling startDetection on FaceDetectorSDK as shown below. You must also pass a valid license string and a config into it.

FaceDetectorSDK.startDetection(this, licenseKey, config, new FaceDetectorResultListener() {
    @Override
    public void onResultReceived(boolean successful, int errorCode, FaceAttr result) {

        if (successful) {
            // handle result
        }
        else {
            // handle error
        }
    }
});

Result

Name

Description

getFaceImage

face image

isFaceDetected

returns true if face detected

isEye1Detected

returns true if first eye is detected

isEye2Detected

return true if second eye is detected

Error Code

errorCode is an int which can have the following values:

Error Code

Constant Name

Description

-1

FaceError.NO_ERROR

Face is successfully detected

1

FaceError.ERROR_INVALID_LICENSE_KEY

The license is invalid

2

FaceError.ERROR_PERMISSION_DENIED

The user did not grant the permission to access camera

3

FaceError.ERROR_USER_CANCEL_ACTION

The user canceled during the scanning process

4

FaceError.ERROR_TIME_OUT

10 seconds timer is triggered when face is detected

Usage

Start by adding the NSCameraUsageDescription to your info.plist.

import FaceDetector module into your swift file.

import FaceDetector

Configuration

Build the configuration object with the following Config properties listed below:

Config

Possible Input Range

Default

path

String

nil

faceThreshold

between 0.0 and 1.0

0.9

eyeThreshold

between 0.0 and 1.0

0.5

let config = Config.Builder()
        .setPath(imagePath)
        .setFaceThreshold(0.9)
        .setEyeThreshold(0.5)
        .build()

SDK Initialization

Start the process by calling startDetection on FaceDetectorSDK as shown below. You must also pass a valid license string and a reference to your view controller. self refers to the current view controller in this example below:

FaceDetectorSDK.startDetection(
    viewController: self,
    license: license,
    config: config
)
{ success, errorCode, result in
    if(success) {
        // handle success
    } else {
        // handle error
    }
}

Result

Name

Description

faceImage

face image

faceDetected

returns true if face detected

eye1Detected

returns true if first eye is detected

eye2Detected

return true if second eye is detected

Error Handling

The error received in the completion handler is of the type FaceError:

public enum FaceError: Error {
    // Error due to invalid parameter value in config object.
    case invalidConfig(_ msg: String)
    
    // Any other errors.
    case miscellaneous(_ msg: String)
    
    // Error due to user clicking cancel and going back.
    case userCancelled
    
    // Error due to invalid license usage.
    case invalidLicense
    
    // No error at all.
    case noError
    
    // Error due to camera permission denied by user.
    case cameraPermission
    
    // image file not found
    case invalidImage
    
    // Timeout error
    case timeout
}

Usage

Import plugin by using the code below

import { detectFaceWithImage, detectFaceWithVideo } from 'react-native-innov8tif-face-detector';

Configurations

Property name
Description
Default value

license

license key

empty

base64

return base64 string as image ouput

false

path

image file path

nil

faceThreshold

face threshold

0.9

eyeThreshold

eye threshold

0.5

Code Implementation

Detect face with video processing

detectFaceWithVideo({
    license: licenseKey,
    base64: true,
    faceThreshold: 0.5,
    eyeThreshold: 0.5
})
    .then(result => {
        console.log(result)
    })
    .catch(error => {
        console.log(error)
    })

Detect face with image processing

detectFaceWithImage({
    license: licenseKey,
    base64: true,
    path: <imagePath>
    faceThreshold: 0.5,
    eyeThreshold: 0.5
})
    .then(result => {
        console.log(result)
    })
    .catch(error => {
        console.log(error)
    })

Result

Result
Description

faceImage

face image output

isFaceDetected

return true if face is detected

isEye1Detected

return true if eye 1 is detected

isEye2Detected

return true if eye 2 is detected

Error Codes

Error
Description

invalid license

The license is invalid

camera permission denied

The user did not grant the permission to access camera

cancel

The user canceled during the scanning process

timeout

Timeout due to face not detected within preset timer

PreviousInstallation GuideNextChangelog

Last updated 3 years ago

Was this helpful?