Mobile

AI Tools

Mobile Face Capture Module (FCM) uses native APIs for face detection and image processing, which keeps our library small in size. This module leverages Google ML Kit for Android and Apple's Vision Library for iOS. Facial images are captured with the front-facing camera. The captured frames are analysed by the module and are cropped automatically, which can then be sent to the Yoti backend API for the age estimation & liveness check.

SICAP is currently only supported in Web FCM. If you prefer to use mobile-native FCM, you should implement code obfuscation, signature verification and encryption within your own application to block injection attacks.

There are two steps to integrate the Mobile FCM:

  1. Install the dependency
  2. Integrate the module into your application

Install the dependency

Yoti currently supports:

  • Android
  • iOS
  • React Native

Prerequisite

Android
iOS
React Native
System requirementsMinimum supported version
Android SDK/API Level21

Camera permission is required to allow capturing the facial image.

AndroidManifest.xml
Copy
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches

Installation

Android
iOS
React Native

We offer two options, bundled and unbundled, to add this module to your app.

VersionSize (armeabi-v7a)Size (arm64-v8a)Description
Bundled11.6 MB15.2 MBThis includes an embedded model for face detection.
Unbundled2.3 MB2.7 MBFace detection model will be installed via Google Play Services at the first application launch.

(1) Bundled version

To integrate the bundled version, simply add the line below to the gradle.properties file.

gradle.properties
Copy

(2) Unbundled version

To integrate the unbundled version, add the following line to the gradle.properties file.

gradle.properties
Copy

It is recommended to add the following metadata to your manifest.xml to get the model downloaded as soon as the app is installed.

AndroidManifest.xml
Copy
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches

Example integration

Below is the example code for FCM integration.

Android
iOS
React Native
FaceCaptureActivity.kt
Copy

More details can be found in our GitHub repository. A sample app is available here for reference.

VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches

Error codes

Android
iOS
React Native
Error codeDescription
FaceNotStraightThe picture must be taken with a tilt angle no bigger than 30 degrees.
EyesClosedEyes must be open when taking the photos.
EnvironmentTooDarkThe environment luminosity is below a pre-determined threshold. Try again with a brighter environment.
FaceNotStableBlurry images are being captured. A number of frames are taken as similar as possible in terms of width/height and x/y position.
AnalysisErrorThe device is not compatible with the SDK, and the capture analysis cannot be performed. We recommend that you fall back to manual capture mode (for details, please check the sample app) if this error happens, so that the user can perform a manual capture.
NoFaceDetectedFace is not detected in the capture area.
MultipleFacesDetectedMultiple faces are detected in the view. Only one face is allowed.
FaceTooSmallThe face is too small. Move closer to the camera.
FaceTooBigThe face is too big. Move away from the camera.
FaceNotCenteredThe face is not positioned at the center of the camera.
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches