Class SelfieScan.Builder
-
- All Implemented Interfaces:
public final class SelfieScan.Builder
-
-
Constructor Summary
Constructors Constructor Description SelfieScan.Builder()
-
Method Summary
Modifier and Type Method Description final SelfieScan.Builder
from(SelfieScan existingSelfieScan)
final SelfieScan.Builder
setShowTutorials(Boolean showTutorials)
Show tutorials how to capture selfie before the actual scan. final SelfieScan.Builder
setWaitForTutorials(Boolean waitForTutorials)
Hide the continue button in the tutorial screen while tutorial animation is playing, in order to make sure user has seen the video before continuing. final SelfieScan.Builder
setMode(SelfieScan.Mode mode)
Sets the Selfie Scan mode (ENROLL, LOGIN or MASK_CHECK). final SelfieScan.Builder
setCameraFacing(CameraFacing cameraFacing)
Sets the direction that the camera faces. final SelfieScan.Builder
setFaceRecognitionMode(SelfieScan.FaceRecognitionMode faceRecognitionMode)
Sets the Face Recognition mode (LOCAL or SERVER). final SelfieScan.Builder
setLivenessDetectionMode(SelfieScan.LivenessDetectionMode livenessDetectionMode)
Sets the Liveness Detection mode (LOCAL or SERVER). final SelfieScan.Builder
setFaceAuthMode(SelfieScan.FaceAuthMode mode)
Sets the Face Auth mode (SERVER or LOCAL). final SelfieScan.Builder
setAllowFaceAuthModeFallback(Boolean allowFaceAuthModeFallback)
Specify true if you would want to do a FaceAuthMode.SERVER face login in case FaceAuthMode.LOCAL couldn't be performed due to missing face template on the device. final SelfieScan.Builder
setBrightnessThreshold(Float brightnessThreshold)
Adjust minimum requirements for a well lit face during capture. final SelfieScan.Builder
setCustomerToken(String customerToken)
Sets the customer token to be used for face login feature. final SelfieScan.Builder
setCustomerUUID(String customerUUID)
Set the ID that uniquely identifies the pre-authorized user who is performing face login. final SelfieScan.Builder
setEyesClosedCheckEnabled(Boolean eyesClosedCheckEnabled)
Enables/disables eyes closed check. final SelfieScan.Builder
setHeadCoverCheckEnabled(Boolean headCoverCheckEnabled)
Enables/disables head cover check. final SelfieScan.Builder
setLensesCheckEnabled(Boolean lensesCheckEnabled)
Enables/disables lenses check. final SelfieScan.Builder
setMaskCheckEnabled(Boolean maskCheckEnabled)
Specify true to enable local face mask check detection during face capture. final SelfieScan.Builder
setBrightnessCheckEnabled(Boolean brightnessCheckEnabled)
Specify true to enable brightness check during face capture. final SelfieScan.Builder
setStoreLocalAuthenticationEnabled(Boolean storeLocalAuthenticationEnabled)
Enables storing the face login attempts in the local database. final SelfieScan.Builder
setLogAuthenticationEnabled(Boolean logAuthenticationEnabled)
Ensures that all the on-device processing data in FaceAuthMode.LOCAL mode gets sent to the server. final SelfieScan.Builder
setAssistedOnboardingEnabled()
Enables assisted onboarding (back-camera-only onboarding). final SelfieScan.Builder
setLogo(@DrawableRes() Integer logoResId)
Used to provide a custom logo to supported screens in the Selfie module. final SelfieScan.Builder
setAutoCaptureTimeout(Integer autoCaptureTimeout)
Sets the selfie auto capture timeout in seconds. final SelfieScan.Builder
setCaptureAttempts(Integer captureAttempts)
Sets the selfie capture attempts. final SelfieScan.Builder
setStreamFramesEnabled(Boolean streamFramesEnabled)
Enables or disables video streaming of the SelfieScan module. final SelfieScan.Builder
setStreamAudioEnabled(Boolean enabled)
Enables or disables audio during streaming of the SelfieScan module. final SelfieScan.Builder
setStreamFramesToken(String streamFramesToken)
Sets the OpenTok streaming token used for streaming a login attempt when SelfieScan mode is set to Mode.LOGIN. final SelfieScan.Builder
setVideoLivenessRecordingEnabled(Boolean enabled)
Enables or disables video recording for video liveness checks of the SelfieScan module in com.incode.welcome_sdk.SdkMode.CAPTURE_ONLY mode. final SelfieScan
build()
-
-
Method Detail
-
from
final SelfieScan.Builder from(SelfieScan existingSelfieScan)
-
setShowTutorials
final SelfieScan.Builder setShowTutorials(Boolean showTutorials)
Show tutorials how to capture selfie before the actual scan. Default value is true.
- Returns:
Builder
-
setWaitForTutorials
final SelfieScan.Builder setWaitForTutorials(Boolean waitForTutorials)
Hide the continue button in the tutorial screen while tutorial animation is playing, in order to make sure user has seen the video before continuing. Does nothing if SelfieScan.isShowTutorials is false. Default value is true.
- Parameters:
waitForTutorials
- true to wait for tutorial animations to finish before continuing.- Returns:
Builder
-
setMode
final SelfieScan.Builder setMode(SelfieScan.Mode mode)
Sets the Selfie Scan mode (ENROLL, LOGIN or MASK_CHECK). Default value is Mode.ENROLL.
- Parameters:
mode
- Selfie Scan mode (ENROLL, LOGIN or MASK_CHECK)- Returns:
Builder
-
setCameraFacing
final SelfieScan.Builder setCameraFacing(CameraFacing cameraFacing)
Sets the direction that the camera faces. It can be CameraFacing.FRONT or CameraFacing.BACK. Default value is CameraFacing.FRONT.
Note: This API has no effect in SDK versions 5.33.1-nu, 5.33.3-nu and 5.36.0
- Parameters:
cameraFacing
- direction that the camera faces.- Returns:
Builder
-
setFaceRecognitionMode
@Deprecated(message = "") final SelfieScan.Builder setFaceRecognitionMode(SelfieScan.FaceRecognitionMode faceRecognitionMode)
Sets the Face Recognition mode (LOCAL or SERVER). Default value is FaceRecognitionMode.SERVER.
When mode is Mode.ENROLL, Face Recognition mode is always FaceRecognitionMode.SERVER
When mode is Mode.MASK_CHECK, Face Recognition mode is always FaceRecognitionMode.LOCAL (mask check is always done locally).
- Parameters:
faceRecognitionMode
- Face Recognition mode (FaceRecognitionMode.LOCAL or FaceRecognitionMode.SERVER).- Returns:
Builder
-
setLivenessDetectionMode
final SelfieScan.Builder setLivenessDetectionMode(SelfieScan.LivenessDetectionMode livenessDetectionMode)
Sets the Liveness Detection mode (LOCAL or SERVER). Default value is LivenessDetectionMode.LOCAL.
When mode is Mode.ENROLL, Liveness Detection mode is always LivenessDetectionMode.SERVER
- Parameters:
livenessDetectionMode
- Liveness Detection mode (LivenessDetectionMode.LOCAL or LivenessDetectionMode.SERVER).- Returns:
Builder
-
setFaceAuthMode
final SelfieScan.Builder setFaceAuthMode(SelfieScan.FaceAuthMode mode)
Sets the Face Auth mode (SERVER or LOCAL). Default value is FaceAuthMode.SERVER.
When mode is FaceAuthMode.SERVER, both Face detection and Liveness Detection are performed by the SERVER
When mode is FaceAuthMode.LOCAL, both Face detection and Liveness Detection are performed locally
- Parameters:
mode
- One of two Face Auth modes (FaceAuthMode.SERVER or FaceAuthMode.LOCAL- Returns:
Builder
-
setAllowFaceAuthModeFallback
final SelfieScan.Builder setAllowFaceAuthModeFallback(Boolean allowFaceAuthModeFallback)
Specify true if you would want to do a FaceAuthMode.SERVER face login in case FaceAuthMode.LOCAL couldn't be performed due to missing face template on the device. This is applied only to 1:1 Face login.
- Returns:
Builder
-
setBrightnessThreshold
final SelfieScan.Builder setBrightnessThreshold(Float brightnessThreshold)
Adjust minimum requirements for a well lit face during capture. Increasing the value will be more restrictive and require better lighting conditions, decreasing the value will loosen requirements and allow capturing while being in a darker environment. Set 0 to ignore this setting. 50 by default.
- Returns:
Builder
-
setCustomerToken
@Deprecated(message = "Please use setCustomerUUID() instead") final SelfieScan.Builder setCustomerToken(String customerToken)
Sets the customer token to be used for face login feature. This token uniquely identifies a customer in OMNI system and it's returned as a result of approve onboarding API call (e.g server REST API). When customer token is set with this API login works in FaceRecognitionMode.SERVER mode always. When using Approval module to approve the customer there is no need to call this API to set the customer token, it's already set internally.
- Returns:
Builder
-
setCustomerUUID
final SelfieScan.Builder setCustomerUUID(String customerUUID)
Set the ID that uniquely identifies the pre-authorized user who is performing face login. When set, 1:1 login is performed. When this value is null, 1:N login is performed.
- Parameters:
customerUUID
- ID that uniquely identifies the pre-authorized user who is performing face login.- Returns:
Builder
-
setEyesClosedCheckEnabled
final SelfieScan.Builder setEyesClosedCheckEnabled(Boolean eyesClosedCheckEnabled)
Enables/disables eyes closed check. Default value is enabled. If enabled:
In auto capture mode, all frames where closed eyes are detected are filtered out and not used for further processing.
In manual capture mode, photos where closed eyes are detected are processed but the results are marked for additional review.
- Parameters:
eyesClosedCheckEnabled
- Boolean to indicate if the eyes closed check should be performed.- Returns:
Builder
-
setHeadCoverCheckEnabled
final SelfieScan.Builder setHeadCoverCheckEnabled(Boolean headCoverCheckEnabled)
Enables/disables head cover check. Default value is disabled. If enabled:
In auto capture mode, all frames where head cover is detected are filtered out and not used for further processing.
In manual capture mode, photos where head cover is detected are processed but the results are marked for additional review.
- Parameters:
headCoverCheckEnabled
- Boolean to indicate if the head cover check should be performed.- Returns:
Builder
-
setLensesCheckEnabled
final SelfieScan.Builder setLensesCheckEnabled(Boolean lensesCheckEnabled)
Enables/disables lenses check. Default value is enabled. If enabled:
In auto capture mode, all frames where lenses are detected are filtered out and not used for further processing.
In manual capture mode, photos where lenses are detected are processed but the results are marked for additional review.
- Parameters:
lensesCheckEnabled
- Boolean to indicate if the lenses check should be performed.- Returns:
Builder
-
setMaskCheckEnabled
final SelfieScan.Builder setMaskCheckEnabled(Boolean maskCheckEnabled)
Specify true to enable local face mask check detection during face capture. Default value is false. If disabled, the Face Mask Check is performed on the server.
- Parameters:
maskCheckEnabled
- Boolean to indicate if the mask check should be performed.- Returns:
Builder
-
setBrightnessCheckEnabled
final SelfieScan.Builder setBrightnessCheckEnabled(Boolean brightnessCheckEnabled)
Specify true to enable brightness check during face capture. Default value is enabled.
- Parameters:
brightnessCheckEnabled
- Set to true to enable brightness check, false otherwise.- Returns:
Builder Returns the updated Builder object with the brightness check configuration.
-
setStoreLocalAuthenticationEnabled
final SelfieScan.Builder setStoreLocalAuthenticationEnabled(Boolean storeLocalAuthenticationEnabled)
Enables storing the face login attempts in the local database.
This configuration is applicable only to the Mode.LOGIN and FaceAuthMode.LOCAL modes. When enabled, authentication attempts are stored locally, and the setLogAuthenticationEnabled configuration is bypassed. Default value is false.
- Parameters:
storeLocalAuthenticationEnabled
- true to enable storing face login attempts locally.- Returns:
Builder
-
setLogAuthenticationEnabled
final SelfieScan.Builder setLogAuthenticationEnabled(Boolean logAuthenticationEnabled)
Ensures that all the on-device processing data in FaceAuthMode.LOCAL mode gets sent to the server. Default value is true.
Specify false if you want to make sure that no network calls are being performed in FaceAuthMode.LOCAL mode. Note that the authentication attempts won't be visible in the dashboard. This configuration is applicable only to the Mode.LOGIN mode.
- Returns:
Builder
-
setAssistedOnboardingEnabled
final SelfieScan.Builder setAssistedOnboardingEnabled()
Enables assisted onboarding (back-camera-only onboarding). This is equivalent to calling
setCameraFacing(CameraFacing.BACK)
.Note: This API has no effect in SDK versions 5.33.1-nu, 5.33.3-nu and 5.36.0
- Returns:
Builder
-
setLogo
final SelfieScan.Builder setLogo(@DrawableRes() Integer logoResId)
Used to provide a custom logo to supported screens in the Selfie module.
- Parameters:
logoResId
- The resource ID for the Drawable of the desired custom logo.- Returns:
Builder
-
setAutoCaptureTimeout
final SelfieScan.Builder setAutoCaptureTimeout(Integer autoCaptureTimeout)
Sets the selfie auto capture timeout in seconds.
- Parameters:
autoCaptureTimeout
- Auto capture timeout value.- Returns:
Builder
-
setCaptureAttempts
final SelfieScan.Builder setCaptureAttempts(Integer captureAttempts)
Sets the selfie capture attempts.
- Parameters:
captureAttempts
- Capture attempts value.- Returns:
Builder
-
setStreamFramesEnabled
final SelfieScan.Builder setStreamFramesEnabled(Boolean streamFramesEnabled)
Enables or disables video streaming of the SelfieScan module. Make sure to include 'com.incode.sdk:video-streaming' in order to use this feature.
Note: This setting is ignored if the ANY of the following are true:
The device has 2GB of RAM or less
If using com.incode.welcome_sdk.SdkMode.CAPTURE_ONLY mode
Using com.incode.welcome_sdk.SdkMode.STANDARD and the "Deepsight Liveness" Face Capture configuration option on the Incode Dashboard is set to: "Video Liveness"
- Parameters:
streamFramesEnabled
- If true, perform streaming during the Selfie scan.- Returns:
Builder
-
setStreamAudioEnabled
final SelfieScan.Builder setStreamAudioEnabled(Boolean enabled)
Enables or disables audio during streaming of the SelfieScan module.
Note: This setting is ignored if SelfieScan.Builder.setStreamFramesEnabled is false, or any conditions where the SelfieScan.Builder.setStreamFramesEnabled setting is ignored.
- Parameters:
enabled
- If true, audio is streamed along with video during SelfieScan.- Returns:
Builder
-
setStreamFramesToken
final SelfieScan.Builder setStreamFramesToken(String streamFramesToken)
Sets the OpenTok streaming token used for streaming a login attempt when SelfieScan mode is set to Mode.LOGIN.
Note: This setting is ignored if Builder.setStreamFramesEnabled is false, or any conditions where the Builder.setStreamFramesEnabled setting is ignored.
- Parameters:
streamFramesToken
- A token generated by your backend.- Returns:
-
setVideoLivenessRecordingEnabled
final SelfieScan.Builder setVideoLivenessRecordingEnabled(Boolean enabled)
Enables or disables video recording for video liveness checks of the SelfieScan module in com.incode.welcome_sdk.SdkMode.CAPTURE_ONLY mode. Make sure to include
com.incode.sdk:camera
in order to use this feature on the-nu
line of SDK releases.Note: In com.incode.welcome_sdk.SdkMode.STANDARD mode, this setting is ignored as enabling video liveness checks are configured server-side and only when performing an onboarding.
- Parameters:
enabled
- If true, a recording of the camera feed will be taken during the SelfieScan module.- Returns:
- Since:
Standard Releases: 5.36.0
Special Versions: [5.33.1-nu](https://developer.incode.com/docs/changelog-special#/version-5331-nu-camera-120-nu---2025-feb-05)
-
build
final SelfieScan build()
-
-
-
-