Title
Create new category
Edit page index title
Edit category
Edit link
Mobile FCM
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:
Install the dependency
Integrate the module into your application
Install the dependency
Yoti currently supports:
Android
iOS
React Native
Prerequisite
System requirements | Minimum supported version |
|---|---|
Android SDK/API Level | 21 |
Camera permission is required to allow capturing the facial image.
System requirements | Minimum supported version |
|---|---|
iOS | 13 |
Swift | 5.5 |
Camera permission is required to allow capturing the facial image.
System requirements | Minimum supported version |
|---|---|
Android SDK/API Level | 21 |
iOS | 12 |
Swift | 5.3 |
React Native | 0.59 |
Camera permission is required to allow capturing the facial image. If your application does not request camera access from the user already, you may consider an in-built approach such as PermissionsAndroid. Alternatively, you may use community libraries like React Native Permissions.
Installation
We offer two options, bundled and unbundled, to add this module to your app.
Version | Size (armeabi-v7a) | Size (arm64-v8a) | Description |
|---|---|---|---|
Bundled | 11.6 MB | 15.2 MB | This includes an embedded model for face detection. |
Unbundled | 2.3 MB | 2.7 MB | Face 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.
(2) Unbundled version
To integrate the unbundled version, add the following line to the gradle.properties file.
It is recommended to add the following metadata to your manifest.xml to get the model downloaded as soon as the app is installed.
There are three installation options. You can install the package through:
(1) Swift Package Manager
Add the following line to your Package.swift file:1
(2) Xcode Package Dependency
Add the package in Xcode via File -> Swift Packages -> Add Package Dependency using the URL of the iOS SDK repository (https://github.com/getyoti/yoti-face-capture-ios)
(3) Podfile
Add the following code to your Podfile and run pod install from its directory:
Install the module with Yarn or npm.
Then, navigate to your iOS folder and install pods with the pod install command. React Native's autolinking will handle the rest of the native configuration. Should autolinking fail, consult the troubleshooting instructions.
Manually link the module with the following command.
react-native link @getyoti/react-native-yoti-face-capture
If you're using CocoaPods, update your Podfile with the following lines and run pod install :
pod 'Folly', :podspec => '../nodemodules/react-native/third-party-podspecs/Folly.podspec'
pod 'react-native-yoti-face-capture', :path => '../node modules/react-native-yoti-face-capture/react-native-yoti-face-capture.podspec'
Example integration
Below is the example code for FCM integration.
More details can be found in our GitHub repository. A sample app is available here for reference.
More details can be found in our GitHub repository. A sample app is available here for reference.
More details can be found in our GitHub repository. A sample app is available here for reference.
Error codes
Error code | Description |
|---|---|
| The picture must be taken with a tilt angle no bigger than 30 degrees. |
| Eyes must be open when taking the photos. |
| The environment luminosity is below a pre-determined threshold. Try again with a brighter environment. |
| Blurry images are being captured. A number of frames are taken as similar as possible in terms of width/height and x/y position. |
| The 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. |
| Face is not detected in the capture area. |
| Multiple faces are detected in the view. Only one face is allowed. |
| The face is too small. Move closer to the camera. |
| The face is too big. Move away from the camera. |
| The face is not positioned at the center of the camera. |
Error code | Description |
|---|---|
| Camera permissions not authorized |
| Camera initialization failed |
| The device is not compatible with the SDK, and the capture analysis cannot be performed. |
| Face is not detected in the capture area. |
| Multiple faces are detected in the view. Only one face is allowed. |
| Eyes must be open when taking the photos. |
| The face is too small. Move closer to the camera. |
| The face is too big. Move away from the camera. |
| The face is not positioned at the center of the camera. |
| Blurry images are being captured. A number of frames are taken as similar as possible in terms of width/height and x/y position. |
| The picture must be taken with a tilt angle no bigger than 30 degrees. |
| The environment luminosity is below a pre-determined threshold. Try again with a brighter environment. |
Error code | Description |
|---|---|
| Eyes must be open when taking the photos. |
| Blurry images are being captured. A number of frames are taken as similar as possible in terms of width/height and x/y position. |
| The picture has to be taken with a tilt angle no bigger than 30 degrees. |
| The picture has to be taken in a bright environment. |
| There was an error initialising the camera. |
| The Face Capture does not have sufficient permissions to access the camera. |
| The Face Capture is in an invalid state. |
| The face is too big. Move away from the camera. |
| The face is too small. Move closer to the camera. |
| Face is not detected in the capture area. |
| The face is not positioned at the center of the camera. |
| The device is not compatible with the SDK, and the capture analysis cannot be performed. |
| Multiple faces are detected in the view. Only one face is allowed. |
Got a question? Contact us here.