Skip to content

Mobile SDK Overview ​

FaceAuthen does not ship its own capture SDK. It reuses the CAKE eKYC Mobile SDK — the same takeFaces entry point that captures a selfie, checks its quality and confirms liveness. This page covers only the parts that matter for face authentication.

Platforms ​

WhatDescription
AndroidKotlin. Entry point CakeEkyc. Current version 1.1.9.
iOSSwift. Entry point CakeEkycSdk. Current version 1.1.9.
FlutterDart. Entry point CakeEkycPlugin. Current version 1.0.0.

What the SDK Does For FaceAuthen ​

takeFaces runs a pipeline and hands you images that already passed quality and liveness:

text
capture faces → upload images → check face sanity → check liveness

That output feeds the two FaceAuthen calls your backend makes:

WhatDescription
Register FacesFirst enrolment. Pass the captured image IDs as faces.
Verify Face AuthenEvery subsequent authentication. Pass the fresh selfie's image IDs.

WARNING

The SDK never calls FaceAuthen. It captures and validates images, then stops. Registration, verification, duplicate handling and the profile lock are all your backend's responsibility — and the authentication_key that closes a transaction only comes from Verify Face Authen.

Common Configuration ​

ParamTypeRequiredDefaultDescription
baseUrlstringYes—Base URL for API requests.
languageCodestringNovivi for Vietnamese, en for English.
tokenProviderTokenProviderYes—Supplies the authentication token. Called with timestamp, path and method.
loggerLoggerNo—Receives info, error and warning messages.

WARNING

TokenProvider.getToken(timestamp, path, method) takes the method and path because the token is a per-request signature, not a static string. Never hardcode it — compute it on your backend. See Request Signing.

Capture Options ​

ParamTypeRequiredDefaultDescription
captureOnlyboolNofalseCapture the image only — no upload, no quality check, no liveness.
loadingViewViewNoSDK defaultReplaces the loading UI shown during upload and checks. Android and iOS only.

SDK Error Codes ​

Raised by the SDK itself, separate from the FaceAuthen API codes.

FieldTypeDescription
40000stringTimeout.
40001stringUser cancelled — pressed back.
40002stringRequired permissions were not granted.
40003stringOpening the camera device failed. Android and Flutter only.
50000stringUnexpected runtime exception.
60002stringFace sanity check failed.
60003stringFace liveness check failed.

Constant names differ per platform — EkycError.FACE_SANITY_FAILED on Android, kErrorCodeFaceSanityFailed on iOS, EkycFailure.faceSanityFailed on Flutter — but the numeric values match.

The NID-related codes 60000 and 60001 exist in the same SDK but never fire in a FaceAuthen flow, which captures no identity card.

Image Labels ​

When calling upload directly, use portrait for a camera selfie. The other labels belong to document flows.

FieldTypeDescription
portraitstringThe portrait photo.
portrait_nfcstringThe portrait read from an NFC chip. Use with face_type: "id_card" at registration.

See Usage Recommendations for the full vocabulary.

Registering From an ID Card ​

Register Faces accepts face_type: "id_card" alongside the default selfie. Use it when the enrolment face comes from a document rather than a live capture — for example a portrait extracted while reading an NID chip. The SDK's takeFaces always produces selfie; an id_card face comes from your document flow instead.

Next Steps ​

Developers