iOS SDK Methods and Properties
OZSDK
A singleton for Oz SDK.
Methods
OZSDK
Initializes OZSDK with the license data. The closure is either license data or LicenseError.
Parameter | Type | Description |
licenseSources | The source of the license |
Returns
-
setLicense
Forces the license installation.
Parameter | Type | Description |
licenseSource | Source of the license |
setApiConnection
Retrieves an access token for a user.
Parameter | Type | Description |
apiConnection | Authorization parameters |
Returns
The access token or an error.
setEventsConnection
Retrieves an access token for a user to send telemetry.
Parameter | Type | Description |
eventsConnection | Telemetry authorization parameters |
Returns
The access token or an error.
isLoggedIn
Checks whether an access token exists.
Parameters
-
Returns
The result – the true or false value.
logout
Deletes the saved access token
Parameters
-
Returns
-
createVerificationVCWithDelegate
Creates the Liveness check controller.
Parameter | Type | Description |
delegate | The delegate for Oz Liveness | |
actions | Captured action | |
cameraPosition (optional) | AVCaptureDevice.Position |
|
Returns
UIViewController or an exception.
createVerificationVC
Creates the Liveness check controller.
Parameter | Type | Description |
actions | Captured action | |
FaceCaptureCompletion | type alias used as follows:
| |
cameraPosition (optional) | AVCaptureDevice.Position |
|
Returns
UIViewController or an exception.
cleanTempDirectory
Deletes all videos.
Parameters
-
Returns
-
getEventSessionId
Retrieves the telemetry session ID.
Parameters
-
Returns
The telemetry session ID (String parameter).
set
Sets the bundle to look for translations in.
Parameter | Type | Description |
languageBundle | Bundle | The bundle that contains translations |
Returns
-
setSelfieLength
Sets the length of the Selfie gesture (in milliseconds).
Parameter | Type | Description |
selfieLength | Int | The length of the Selfie gesture (in milliseconds). Should be within 500-5000 ms, the default length is 700 |
generateSignedPayload
Generates the payload with media signatures.
Parameter | Type | Description |
media | An array of media files |
Returns
Payload to be sent along with media files that were used for generation.
Properties
localizationCode
SDK locale (if not set, works automatically).
Parameter | Type | Description |
localizationCode | The localization code |
host
The host to call for Liveness video analysis.
Parameter | Type | Description |
host | String | Host address |
attemptSettings
The holder for attempts counts before SDK returns error.
Parameter | Type | Description |
singleCount | Int | Attempts on a single action/gesture |
commonCount | Int | Total number of attempts on all actions/gestures if you use a sequence of them |
faceAlignmentTimeout | Float | Time needed to align face into frame |
uploadMediaSettings | Sets the number of attempts and timeout between them |
version
The SDK version.
Parameter | Type | Description |
version | String | Version number |
OZLivenessDelegate
A delegate for OZSDK.
Methods
onOZLivenessResult
Gets the Liveness check results.
Parameter | Type | Description |
results | [OzMedia] | An array of the OzMedia objects. |
Returns
-
onError
The error processing method.
Parameter | Type | Description |
status | The error description. |
Returns
-
AnalysisRequest
A protocol for performing checks.
Methods
AnalysisRequestBuilder
Creates the AnalysisRequest instance.
Parameter | Type | Description |
folderId (optional) | String | The identifier to define when you need to upload media to a certain folder. |
Returns
The AnalysisRequest instance.
addAnalysis
Adds an analysis to the AnalysisRequest instance.
Parameter | Type | Description |
analysis | A structure containing information on the analyses required. |
Returns
-
uploadMedia
Uploads media on server.
Parameter | Type | Description |
media | Media or an array of media objects to be uploaded. |
Returns
-
addFolderId
Adds the folder ID to upload media to a certain folder.
Parameter | Type | Description |
folderId | String | The folder identifier. |
Returns
-
addFolderMeta
Adds metadata to a folder.
Parameter | Type | Description |
meta | [String] | An array of metadata as follows: ["meta1": "data1"] |
Returns
-
run
Runs the analyses.
Parameter | Type | Description |
statusHandler | A callback function as follows:
| The handler that is executed when the scenario state changes |
errorHandler | A callback function as follows:
| Error handler |
completionHandler | A callback function as follows:
| The handler that is executed when the run method completes. |
Returns
The analysis result or an error.
Customization
Customization for OzLivenessSDK (use OZSDK.customization
).
toolbarCustomization
A set of customization parameters for the toolbar.
Parameter | Type | Description |
closeButtonIcon | UIImage | An image for the close button |
closeButtonColor | UIColor | Close button |
titleFont | UIFont | Toolbar title text font |
titleColor | UIColor | Toolbar title text color |
backgroundColor | UIColor | Toolbar background color |
titleText | String | Text on the toolbar |
centerHintCustomization
A set of customization parameters for the center hint that guides a user through the process of taking an image of themselves.
Parameter | Type | Description |
textFont | UIFont | Center hint text font |
textColor | UIColor | Center hint text color |
backgroundColor | UIColor | Center hint text background |
verticalPosition | Int | Center hint vertical position from the screen top (in %, 0-100) |
hideTextBackground | Bool | Hides text background |
backgroundCornerRadius | Int | Center hint background frame corner radius |
hintAnimationCustomization
A set of customization parameters for the hint animation.
Parameter | Type | Description |
hideAnimation | Bool | A switcher for hint animation, if |
animationIconSize | CGfloat | A side size of the animation icon square |
hintGradientColor | UIColor | The close-to-frame gradient color |
faceFrameCustomization
A set of customization parameters for the frame around the user face.
Parameter | Type | Description |
geometryType | The frame type: oval, rectangle, circle, or square | |
cornerRadius | CGFloat | Rectangle corner radius (in dp) |
strokeFaceNotAlignedColor | UIColor | Frame color when a face is not aligned properly |
strokeFaceAlignedColor | UIColor | Frame color when a face is aligned properly |
strokeWidth | CGFloat | Frame stroke width (in dp, 0-20) |
strokePadding | CGFloat | A padding from the stroke to the face alignment area (in dp, 0-10) |
backgroundCustomization
A set of customization parameters for the background outside the frame.
Parameter | Type | Description |
backgroundColor | UIColor | Background color |
versionCustomization
A set of customization parameters for the SDK version text.
Parameter | Type | Description |
textFont | UIFont | SDK version text font |
textColor | UIColor | SDK version text color |
antiscamCustomization
A set of customization parameters for the antiscam message that warns user about their actions being recorded.
Parameter | Type | Description |
customizationEnableAntiscam | Bool | Adds the antiscam message |
customizationAntiscamTextMessage | String | Antiscam message text |
customizationAntiscamTextFont | UIFont | Antiscam message text font |
customizationAntiscamTextColor | UIColor | Antiscam message text color |
customizationAntiscamBackgroundColor | UIColor | Antiscam message text background color |
customizationAntiscamCornerRadius | CGFloat | Background frame corner radius |
customizationAntiscamFlashColor | UIColor | Color of the flashing indicator close to the antiscam message |
logoCustomization
Logo customization parameters. Custom logo should be allowed by license.
Parameter | Type | Description |
image | UIImage | Logo image |
size | CGSize | Logo size (in dp) |
Variables and Objects
enum LicenseSource
A source of a license.
Case | Description |
licenseFilePath | An absolute path to a license (String) |
licenseFileName | The name of the license file |
struct LicenseData
The license data.
Parameter | Type | Description |
appIDS | [String] | An array of bundle IDs |
expires | TimeInterval | The expiration interval |
features | Features | License features |
configs (optional) | ABTestingConfigs | Additional configuration |
enum OzVerificationMovement
Contains action from the captured video.
Case | Description |
smile | Smile |
eyes | Blink |
scanning | Scan |
selfie | A selfie with face alignment check |
one_shot | The best shot from the video taken |
left | Head turned left |
right | Head turned right |
down | Head tilted downwards |
up | Head lifted up |
enum OZLocalizationCode
Contains the locale code according to ISO 639-1.
Case | Description |
en | English |
hy | Armenian |
kk | Kazakh |
ky | Kyrgyz |
tr | Turkish |
es | Spanish |
pt-BR | Portuguese (Brazilian) |
custom(String) | Custom language (language ISO 639-1 code, two letters) |
struct OZMedia
Contains all the information on the media captured.
Parameter | Type | Description |
movement | User action type | |
mediaType | Type of media | |
metaData | [String] as follows: ["meta1": "data1"] | Metadata if any |
videoURL | URL | URL of the Liveness video |
bestShotURL | URL | URL of the best shot in PNG |
preferredMediaURL | URL | URL of the API media container |
timestamp | Date | Timestamp for the check completion |
enum MediaType
The type of media captured.
Case | Description |
movement | A media with an action |
documentBack | The back side of the document |
documentFront | The front side of the document |
enum OZVerificationStatus
Error description.
Case | Description |
userNotProcessed | The Liveness check was not processed |
failedBecauseUserCancelled | The check was interrupted by user |
failedBecauseCameraPermissionDenied | The Liveness check can't be performed: no camera access |
failedBecauseOfBackgroundMode | The Liveness check can't be performed: background mode |
failedBecauseOfTimeout | The Liveness check can't be performed: timeout |
failedBecauseOfAttemptLimit | The Liveness check can't be performed: attempts limit exceeded |
failedBecausePreparingTimout | The Liveness check can't be performed: face alignment timeout |
failedBecauseOfLowMemory | The Liveness check can't be performed: no memory left |
struct Analysis
Contains information on what media to analyze and what analyses to apply.
Parameter | Type | Description |
media | [OzMedia] | An array of the OzMedia objects |
type | The type of the analysis | |
mode | The mode of the analysis | |
sizeReductionStrategy | Defines what type of media is being sent to the server in case of the hybrid analysis once the on-device analysis is finished successfully | |
params (optional) | String | Additional parameters |
enum AnalysisType
The type of the analysis.
Case | Description |
biometry | The algorithm that allows comparing several media and check if the people on them are the same person or not |
quality | The algorithm that aims to check whether a person in a video is a real human acting in good faith, not a fake of any kind. |
document | The analysis that aims to recognize the document and check if its fields are correct according to its type. |
blacklist | The analysis that compares a face on a captured media with faces from the pre-made media database. |
Currently, the .document analysis can't be performed in the on-device mode.
enum AnalysisMode
The mode of the analysis.
Case | Description |
onDevice | The on-device analysis with no server needed |
serverBased | The server-based analysis |
hybrid | The hybrid analysis for Liveness: if the score received from an on-device analysis is too high, the system initiates a server-based analysis as an additional check. |
enum ScenarioState
Shows the media processing status.
Case | Description |
addToFolder | The system is creating a folder and adding files to this folder |
addAnalyses | The system is adding analyses |
waitAnalysisResult | The system is waiting for the result |
struct AnalysisStatus
Shows the files' uploading status.
Parameter | Type | Description |
media | The object that is being uploaded at the moment | |
index | Int | Number of this object in a list |
from | Int | Objects quantity |
progress | Progress | Object uploading status |
RequestStatus
Shows the analysis processing status.
Parameter | Type | Description |
status | Processing analysis status | |
progressStatus | Media uploading status |
ResultMedia
Describes the analysis result for the single media.
Parameter | Type | Description |
resolution | Consolidated analysis result | |
sourceId | String | Media identifier |
isOnDevice | Bool | Analysis mode |
confidenceScore | Float | Resulting score |
mediaType | String | Media file type: VIDEO / IMAGE / SHOT_SET |
media | Media that is being analyzed | |
error | AnalysisError (inherits from Error) | Error |
RequestResult
Contains the consolidated analysis results for all media.
Parameter | Type | Description |
resolution | Consolidated analysis result | |
folderId | String | Folder identifier |
analysisResults | A list of analysis results |
class AnalysisResult
Contains the results of the checks performed.
Parameter | Type | Description |
resolution | Analysis resolution | |
type | Analysis type | |
mode | Analysis mode | |
analysisId | String | Analysis identifier |
error | AnalysisError (inherits from Error) | Error |
resultMedia | Results of the analysis for single media files | |
confidenceScore | Float | The resulting score |
serverRawResponse | String | Server response |
enum AnalyseResolutionStatus
The general status for all analyses applied to the folder created.
Case | Description |
INITIAL | No analyses have been applied yet |
PROCESSING | The analyses are in progress |
FAILED | One or more analyses failed due to some error and couldn't get finished |
FINISHED | The analyses are finished |
DECLINED | The check failed (e.g., faces don't match or some spoofing attack detected) |
SUCCESS | Everything went fine, the check succeeded (e.g., faces match or liveness confirmed) |
OPERATOR_REQUIRED | The result should be additionally checked by a human operator |
struct AnalyseResolution
Contains the results for single analyses.
Parameter | Type | Description |
analyseResolutionStatus | The analysis status | |
type | The analysis type | |
folderID | String | The folder identifier |
score | Float | The result of the check performed |
enum GeometryType
Frame shape settings.
Case | Description |
oval | Oval frame |
rectangle(cornerRadius: CGFloat) | Rectangular frame (with corner radius) |
circle | Circular frame |
square(cornerRadius: CGFloat) | Square frame (with corner radius) |
enum LicenseError
Possible license errors.
Case | Description |
licenseFileNotFound | The license is not found |
licenseParseError | Cannot parse the license file, the license might be invalid |
licenseBundleError | The |
licenseExpired | The license is expired |
enum Connection
The authorization type.
Case | Description |
fromServiceToken | Authorization with a token:
|
fromCredentials | Authorization with credentials:
|
struct UploadMediaSettings
Defines the settings for the repeated media upload.
Parameter | Type | Description |
---|---|---|
attemptsCount | Int | Number of attempts for media upload |
attemptsTimeout | Int | Timeout between attempts |
enum SizeReductionStrategy
Defines what type of media is being sent to the server in case of the hybrid analysis once the on-device analysis is finished successfully. By default, the system uploads the compressed video.
uploadOriginal | The original video |
uploadCompressed | The compressed video |
uploadBestShot | The best shot taken from the video |
uploadNothing | Nothing is sent (note that no folder will be created) |
Last updated