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?

  1. OkayCam - Mobile SDK

Development (Face Capture)

This page contains the information of Usage, Configuration, Result of OkayCam for Android, iOS and React-native in Face Capture

PreviousDevelopment (Document Capture)NextError/Exception Handling

Last updated 3 years ago

Was this helpful?

Usage

For Android, a selfie camera can be launched by invoking the start method on OkayCamSelfie with context, license key, config and callback method:

  • A License Key is required to start the SDK.

OkayCamSelfie.start(this,license_key, config) {
success, images, exception -> 
    // do something with the result 
}

Configuration

  • The configuration object is optional if is calling from .

  • The configuration object can be created and can be customised as following:

val config = OkaySelfieConfig.init(this)
config.topLabel.text = "Top Label"

List of Possible Configurations

This is a complete list of possible configurations that has been provided to the user to make any custom configuration:

-

Property

Description

Default Value

-

width

width to resize the image

null

-

imageQuality

quality of image

1.0f (range from 0 to 1.0)

-

outputPath

desired output image path

null

-

defaultCameraFacing

initial camera facing when the selfie camera is launched

CameraFacing.FRONT

topLabel

text

text of the top label

"Please align your face within the frame"

topLabel

color

color of the top label

#FFFFFF

topLabel

size

text size of the top label

24

-

bottomFrameColor

color of the bottom frame

#EB6709

-

captureBtnColor

color of the capture button

#EB144C

confirmBtnConfig

backgroundColor

background color of the confirm button

#EB144C

confirmBtnConfig

contentColor

content color of the confirm button

#FFFFFF

retakeBtnConfig

backgroundColor

background color of the retake button

#EB144C

retakeBtnConfig

contentColor

content color of the retake button

#FFFFFF

switchBtnConfig

color

color of the switch button

#FFFFFF

switchBtnConfig

show

show or hide the camera switch button

true

If there is no value is set for properties, default values will be implied.

Result Callback

  • After the image is capture or cancelled by the user, the callback method will be called.

  • Result callback has 3 parameters as follow:

Conditions

Results

Success

It will be true if the image is captured successfully, else it will return false.

Images

If it is successful, images will contain the file path the image, else it will return null.

Exception

If it is successful, the exception will be null, else it will contain the exception that occurred during the image capturing.

Base64 Conversion

import com.innov8tif.okaycam.utils.BitmapUtils;

String result = BitmapUtils.INSTANCE.convertToBase64(image);

Usage

For iOS, there will be several steps to initialize and configure the Face Capture settings.

  • Instantiate the configuration object. A reference must be passed into the Navigation Controller as follows:

let config = OkaySelfieConfig(navigationController: nav)
  • Start the process by calling start on OkaySelfieCam class. Similarly, the result can be handle in the completion handler.

OkayCamSelfie.start{
    okaySelfieConfig: config,
    license: licenseKey,
    { filePath, error in
        // handle
    }
}
  • The response will only be the <filePath> or an error. One of them will be valid and the other one will be nil.

Configuration

The configuration object can be modified as follow:

let config = OkaySelfieConfig(navigationController: nav)
    config.topLabel.text = "top label text"
    config.topLabel.color = .green
    config.topLabel.size = 14
    config.bottomFrameColor = .darkGray
    config.bottomBtnColor = .white
    config.switchBtnConfig.show = true
    config.switchBtnConfig.color = .magenta
    config.confirmBtnConfig.backgroundColor = .blue
    config.confirmBtnConfig.contentColor = .black
    config.retakeBtnConfig.backgroundColor = .orange
    config.retakeBtnConfig.contentColor = .black
    config.width = 250
    config.imageQuality = 1.0
    config.defaultCameraFacing = .back
    config.outputPath = myCustomFilePath

List of Possible Configurations

This is a complete list of possible configurations that has been provided to the user to make any custom configuration:

Property

Type

Default Value

topLabel

OkaySelfieLabelConfig

OkaySelfieLabelConfig(text: "Please align your face within the frame", color: UIColor.white, size: CGFloat(18))

bottomFrameColor

UIColor

UIColor(red: 0.92, green: 0.40, blue: 0.04, alpha: 1.0)

captureBtnColor

UIColor

UIColor(red: 0.92, green: 0.08, blue: 0.30, alpha: 1.0)

confirmBtnConfig

OkayCamBtnConfig

OkayCamBtnConfig(

backgroundColor: UIColor(red: 0.92, green: 0.08, blue: 0.30, alpha: 1.0),

contentColor: UIColor.white

)

retakeBtnConfig

OkayCamBtnConfig

OkayCamBtnConfig(

backgroundColor: UIColor(red: 0.92, green: 0.08, blue: 0.30, alpha: 1.0),

contentColor: UIColor.white

)

switchBtnConfig

SwitchBtnConfig

SwitchBtnConfig(color: UIColor.white, show: false)

defaultCameraFacing

OkayCam.CameraDevice

OkayCam.CameraDevice.front

outputPath

URL?

nil

width

Int?

nil

imageQuality

CGFloat

1.0 (range from 0 to 1.0)

Result Callback

  • After the image is capture or cancelled by the user, the callback method will be called.

  • Result callback has 2 parameters as follow:

Result

Description

filepath

If it is successful, image path will be returned, else nil will be returned.

error

If it is successful, the error will be nil, else it will contain the error that occurred during the image capturing.

Base64 Conversion

do {
    let base64String = try convertImageToBase64(fileUrl: myImageFilePath)
    print(base64String)
} catch  {
    print(error.localizedDescription)
}

Usage

For React-native, this is an example for the face capture for the custom camera UI design as following:

captureDocument(license, base64, config)

To generate base64 string as output, base64 parameter needs to be set as true.

import { captureSelfie } from "react-native-okaycam"

captureSelfie(
	license,
	true,
	{
		topLabel: {
			text: "Align you face within the frame",
			color: "#4287f5",
			size: 20
		},
		bottomFrameColor: "#4287f5",
		captureBtnColor: "#ffffff",
		switchBtnConfig: {
			color: "#ffffff",
			show: true
		},
		confirmBtnConfig: {
      backgroundColor: "#4287f5",
      contentColor: "#000000"
    },
    retakeBtnConfig: {
      backgroundColor: "#4287f5",
      contentColor: "#000000"
    },
		defaultCameraFacing: "front",
		width: 1000,
		imageQuality: 1.0
	}
)
	.then(result => {
		console.log(result)
	})
	.catch(error => {
		console.log(error)
	})

Configuration

There are some configurations object to be followed in the development stage. The configurations that are going to show below can be implemented into the Usage section above.

List of Possible Configurations

-

Property

Description

Default Value

-

width

width to resize the image

null

-

imageQuality

quality of image

1.0 (range from 0 to 1.0)

topLabel

text

text of the top label

Please align your face within the frame

topLabel

color

color of the top label

#FFFFFF

topLabel

size

text size of the top label

24

-

bottomFrameColor

color of the bottom frame

#EB6709

switchBtnConfig

color

color of the switch button

#FFFFFF

switchBtnConfig

show

show or hide the camera switch button

true

-

captureBtnColor

color of the capture button

#FFFFFF

confirmBtnConfig

backgroundColor

background of the confirm button

#EB144C

confirmBtnConfig

contentColor

content color of the confirm button

#FFFFFF

retakeBtnConfig

backgroundColor

background of the retake button

#EB144C

retakeBtnConfig

contentColor

content color of the retake button

#FFFFFF

-

defaultCameraFacing

Initial camera facing when the selfie cam is launched

CameraFacing.FRONT

Result

Result

Description

selfieImage

Captured selfie image

User Interface Example

The OkayCam (face capture) camera user interface follows the design configurations from the above sections.

Example:

Kotlin
Figure above shows the design of the custom camera UI for OkayCam (face capture)