LogoLogo
  • Innov8tif eKYC Individual APIs & Mobile SDK
  • Centralized API - EMAS eKYC Portal
  • OkayID
    • OkayID - All
      • OCR API
        • Versions
        • Sample Input
        • Sample Response
      • Get Document Type API
        • Versions
        • Sample Input
        • Sample Response
        • Supported Document Type
          • Brunei
            • Sample Response
          • Cambodia
            • Sample Response
          • China
            • Sample Response
          • Hong Kong
            • Sample Response
          • Indonesia
            • Sample Response
          • Malaysia
            • Sample Response
          • Myanmar
            • Sample Response
          • Philippines
            • Sample Response
          • Singapore
            • Sample Response
          • Thailand
            • Sample Response
          • United Arab Emirates
            • Sample Response
          • Vietnam
            • Sample Response
          • Passport
            • Sample Response
      • Field Type Reference
        • Field Type Lists
        • MRZ-Visual FieldType on Nationality
        • Supported Documents
          • Brunei
          • Cambodia
          • China
          • Hong Kong
          • Indonesia
          • Malaysia
          • Myanmar
          • Philippines
          • Singapore
          • Thailand
          • United Arab Emirates
          • Vietnam
          • Passport
      • Document Type Information
      • Error Lists
      • Image Requirements
      • Change Log
      • FAQ
  • OkayID-Lite
    • OkayID-Lite - All
      • Supported Countries
        • Indonesia
          • Versions
          • Sample Input
          • Sample Response
        • Malaysia (Deprecated)
          • Versions
          • Input Sample
          • Sample Response
        • Thailand
          • Versions
          • Sample Input
          • Sample Response
        • Japan (Non-Roman Characters)
          • Versions
          • Sample Input
          • Sample Response
        • Cambodia (Non-Roman Character)
          • Versions
          • Sample Input
          • Sample Response
          • Change Log
      • Supported DocType
      • Image Requirements
      • Change Log
      • Malaysia's Electricity Bill OCR
        • Sample Input
        • Sample Response
        • Supported Document Type
        • Error Lists
        • Change Log
      • Malaysia's KWSP Document (BETA)
        • Sample Input
        • Sample Response
        • FieldType Lists
        • Supported Document Type
        • Error Lists
        • Change Log
      • Malaysia's LHDN Document (BETA)
        • Sample Input
        • Sample Response
        • FieldType Lists
        • Supported Document Type
        • Error Lists
        • Change Log
  • OkayID - Mobile SDK
    • OkayID NFC Mobile SDK - All
      • Getting Started with OkayID NFC Mobile SDK
      • Installation Guide
      • Development Guide
      • Change Log
        • Android
        • iOS
    • OkayID Lite Mobile SDK - All
      • Getting Started with OkayID Lite Mobile SDK
      • Installation Guide
      • Development Guide
      • Changelog
  • OkayLive
    • OkayLive - All
      • Anti-spoofing
        • Versions
        • Sample Input
        • Sample Response
      • Error Lists
      • Image Requirement
      • Change Log
      • FAQ
  • OkayLive++
    • OkayLive++ - All
      • Anti-spoofing
        • Versions
        • Sample Input
        • Sample Response
      • Error Lists
      • Image Requirement
      • Change Log
  • OkayFace
    • OkayFace - All
      • Face Verification
        • Versions
        • Sample Input
        • Sample Response
        • Change Log
      • Interpretation of Results
      • Thresholding
      • Image Requirements
      • Error Lists
      • Face Search [Deprecated]
        • Face Insert
          • Sample Input
        • Face Query
          • Sample Input
        • Thresholding
        • Change Log
      • FAQ
  • OkayFace Search
    • OkayFace Search - All
      • Search Face API
        • Versions
        • Sample Input
        • Sample Response
        • Change Log
      • Get Token API
        • Versions
        • Sample Input
        • Sample Response
        • Change Log
      • How to encrypt and decrypt data
      • OkayFace Search Scenarios
      • FS-Interpretation of Results
      • FS-Image Requirements
      • FS-Error Lists
  • Face Detector - Mobile SDK
    • Face Detector - Mobile SDK - All
      • Getting Started with Face Detector
      • Installation Guide
      • Development Guide
      • Change Log
        • Android
        • iOS
        • React-Native
  • OkayDoc
    • OkayDoc - All
      • Supported Documents
        • Brunei
          • BN - Domestic ID Card
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • BN - Permanent ID Card
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
        • Cambodia
          • KH - ID Card Front
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • KH - ID Card Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
        • China
          • CN - ID Card Front
            • Versions
            • Sample Input
            • Sample Response
            • Example for Landmark
            • Recommended Threshold
            • Change Log
          • CN - ID Card Back
            • Versions
            • Sample Input
            • Sample Response
            • Example for Landmark
            • Recommended Threshold
            • Change Log
        • Taiwan
          • TW - ID Card Front
            • Versions
            • Sample Input
            • Sample Response
            • Example for Landmark
            • Recommended Threshold
            • Change Log
          • TW - ID Card Back
            • Versions
            • Sample Input
            • Sample Response
            • Example for Landmark
            • Recommended Threshold
            • Change Log
        • Hong Kong
          • HK - ID Card Front
            • Versions
            • Sample Input
            • Sample Response
            • Recommended Threshold
            • Example for landmark
            • Change Log
          • HK - ID Card Back
            • Versions
            • Sample Input
            • Sample Response
            • Recommended Threshold
            • Example for landmark
            • Change Log
        • Indonesia
          • IDN - e-KTP Front
            • Versions
            • Sample Input
            • Sample for Landmarks
            • Sample Response
            • Recommended Threshold
            • Change Log
          • IDN - e-KTP Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • IDN - Driving License (2019) Front
            • Versions
            • Sample Input
            • Sample for Landmarks
            • Sample Response
            • Recommended Threshold
            • Change Log
          • IDN - Driving License (2019) Back
            • Versions
            • Sample Input
            • Sample for Landmarks
            • Sample Response
            • Recommended Threshold
            • Change Log
        • Malaysia
          • MYS - MyKad Front
            • Versions
            • Sample Input
            • Sample Response
            • Detection and Thresholding Sample
            • Recommended Threshold
            • Change Log
          • MYS - MyKad Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • MYS - MyKas
            • Versions
            • Sample Input
            • Sample for Landmarks
            • Sample Response
            • Recommended Threshold
            • Change Log
          • MYS - MyKas Back
            • Versions
            • Sample Input
            • Sample for Landmarks
            • Sample Response
            • Recommended Threshold
            • Change Log
          • MYS - MyPR
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • MYS - MyPR Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • MYS - MyTentera
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • MYS - MyTentera Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • MYS - Driving License
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • MYS - MyOKU
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • MYS - MyOKU Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • MYS-MyKid
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • MYS-MyKid Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • MYS-MyPOCA
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
        • Myanmar
          • MM - Driving License
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
        • Philippines
          • PH - Driving License
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • PH - Driving License Back
            • Versions
            • Sample Input
            • Sample Response
            • Recommended Threshold
            • Change Log
          • PH - SSS
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • PH - SSS Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • PH - UMID
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • PH - Voter ID
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • PH - Postal ID
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • PH - Postal ID Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • PH - PRC Professional ID Card
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • PH - PRC Professional ID Card Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • PH - National ID/PhilSys
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • PH - National ID/PhilSys Back
            • Versions
            • Sample Input
            • Sample Response
            • Recommended Threshold
            • Change Log
        • Singapore
          • SG - NRIC/PR Front
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Additional Information
            • Change Log
          • SG - NRIC/PR Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
        • Thailand
          • TH - ID Card
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • TH - ID Card Back
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
        • United Arab Emirates
          • UAE - ID Card
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
        • Vietnam
          • VN - Old ID Card
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
          • VN - New ID Card
            • Versions
            • Sample Input
            • Sample Response
            • Sample for Landmarks
            • Recommended Threshold
            • Change Log
        • Non-passport
          • Versions
          • Sample Input
          • Sample Response
          • Supported Document
          • Flash Image Supported ID Document
          • Change Log
        • Passport
          • Versions
          • Sample Input
          • Sample Response
          • Recommended Threshold
          • Sample Landmarks check for Passport
          • Half-sized and Full-sized Passport Image Samples
          • Change Log
      • Data Consistency Check
        • Versions
        • Sample Response
        • Passport MRZ-Visual Consistency Check and MRZ Validity
        • Change Log
      • Supported Documents and Check Type
      • Error Lists
      • Image Requirements
      • FAQ
  • OkayDoc - Mobile SDK
    • OkayDoc - Mobile SDK - All
      • Getting Started with OkayDoc
      • Installation Guide
      • Development Guide
      • Change Log
  • OkayCam - Mobile SDK
    • OkayCam - Mobile SDK - All
      • Getting Started with OkayCam
      • Installation Guide
      • Development Guide (Document Capture)
      • Development Guide (Face Capture)
      • Error/Exception Handling
      • Change Log
        • Android
        • iOS
        • React-Native
  • OkayDB
    • OkayDB - All
      • AML
        • Search Business
          • Versions
          • Sample Input
          • Sample Response
          • API Response Schema
        • Search By BusinessID
          • Versions
          • Sample Response
        • Search Person
          • Versions
          • Sample Input
          • Sample Response
          • API Response Schema
        • Search By Person ID
          • Versions
          • Sample Response
        • Save Result as PDF
          • Versions
          • Sample Input
          • Sample Response
        • AML Postman Collection
        • Error List
        • Change Log
      • Digital Footprint Analysis
        • Versions
          • Sample Input
          • Sample Response
          • Error Lists
          • Change Log
      • Supported Countries
        • Indonesia
          • e-KTP Check
            • Versions
            • Sample Input
            • Sample Response
            • Change Log
        • Malaysia
          • Information Checks
            • Versions
            • Sample Input
            • Sample Response
            • Change Log
        • Vietnam [NOT SUPPORTED]
          • Driver License Check
            • Versions
            • Sample Input
            • Sample Response
            • Change Log
      • FAQ
  • IntelliDoc
    • IntelliDoc - All
      • Document Recognition
        • Verify
          • Verify - Versions
          • Verify - Sample Input
          • Verify - Sample Response
        • IntelliDoc - Postman Collection
        • IntelliDoc - Error Message List
        • IntelliDoc - Change Log
      • Supported Document & Fields
        • Malaysia
  • Web eKYC
    • Web eKYC - All
      • OkayID Web Camera
        • HTML Media Capture - Upload Approach
        • Web RTC - High Resolution
        • Web RTC - Screen Capture
        • Operating System Detection
      • OkayLive Web Camera
      • Differences of Web eKYC & Native eKYC
  • Other APIs
    • Other APIs - All
      • Fake ID Detection
        • Sample Input
      • Get Details by ID
        • Sample Input
  • Others
    • Others - All
      • IDV App Download URL
        • Change Log
      • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. Face Detector - Mobile SDK
  2. Face Detector - Mobile SDK - All

Development Guide

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 GuideNextChange Log

Last updated 3 years ago

Was this helpful?