LogoLogo
Home
  • Youverify API Documentation
  • Getting Started
    • Getting your API Key
    • Getting your Public Merchant Key
    • Environment
    • Response Codes
  • Know Your Customer Services (KYC)
    • ID Document Verification (SDK)
      • Web SDK
      • iOS SDK
        • iOS Liveness SDK
        • iOS (Compat) Liveness SDK
        • iOS Document Capture SDK
      • Android SDK
        • Android Document Capture SDK
        • Android Liveness SDK
      • Document Capture Supported Countries
        • 🌏Asia
        • πŸ‡ͺπŸ‡ΊEurope
        • 🌎Latin America and the Caribbean
        • 🌍Middle East and Africa
        • 🌎North America
        • 🌏Oceania
    • ID Data Matching (eIDV)
      • 🌐Global
        • Supported Countries
      • πŸ‡ΏπŸ‡¦South Africa
        • Verify South African ID Number (SAID)
        • Verify South African Phone Number
        • Bank Account Verification
        • Proof of Address Verification
      • πŸ‡°πŸ‡ͺKenya
        • Verify International Passport
        • Verify Alien ID
        • Verify Drivers License
        • Verify Plate Number
        • Verify Collateral ID
        • Kenyan Bank Account Verification
          • Bank List
        • Credit History
        • Employment History
        • Verify Address Information
        • Verify Phone Number
        • Verify Identity Number
        • Verify Tax PIN
      • πŸ‡¬πŸ‡­Ghana
        • Verify International Passport
        • Verify Social Security and National Insurance Trust (SSNIT)
        • Verify Ghana Voters Card (GVC)
      • πŸ‡³πŸ‡¬Nigeria
        • Verify Bank Verification Number (BVN)
        • Verify Bank Verification Number (BVN Premium)
        • Verify Virtual National Identification Number (vNIN)
        • Verify National Identification Number (NIN)
        • Verify Nigerian Driver's License (Driver's License)
        • Advanced Phone Search
        • Verify Nigerian International Passport (Passport)
        • Verify Nigerian Permanent Voters Card (PVC)
        • Verify Phone Number
        • Individual Credit Report
        • Bank Account Verification
          • Basic Bank Account Verification
          • Bank List
            • Getting the list of Banks for Basic Bank Account
    • Facial Comparison
    • Retrieve an Identity
    • Identity History
  • Know Your Business Services (KYB)
    • 🌍Business Verification
    • 🌍Search for Businesses
    • Get Supported Countries and Regions
    • Retrieve Business details
    • Country-Specific KYB Services
      • πŸ‡³πŸ‡¬Nigeria
        • Tax Identification Number (TIN) Verification
      • πŸ‡ΏπŸ‡¦South Africa
        • Business Account Verification
        • Business Address Verification
  • Know Your Transaction Service (KYT)
    • Customer Management
      • Create an Individual Client
      • Create a Business Client
      • Initiate an Individual Client Assessment
      • Initiate an Business Client Assessment
      • Update a Client
      • Retrieve all Clients
      • Retrieve a Client
      • Delete a Client
    • Transaction Management
      • Create a Transaction
      • Retrieve an Evaluation
  • Risk Intelligence
    • Risk Intelligence: Initialise Risk Check
    • Retrieve Risk Intelligence Profile
    • Retrieve Risk Intelligence History
  • AML Services (Anti-Money Laundering)
    • PEP and Sanction Screening
      • Search using Name
        • Advanced Filters
      • Search using Identity
        • Advanced Filters
      • Search using Crypto
        • Advanced Filters
      • Retrieve a PEP and Sanction Screening Search
      • Screening Data Sources
      • Domestic PEP Search
    • Adverse Media Intelligence
    • Custom AML Watchlist
      • AML Watchlist (Sample list)
      • AML Watchlist Upload (Bulk Upload)
      • AML Watchlist Upload
      • Retrieve AML Watchlist
      • AML Watchlist Entity Update
      • AML Watchlist Entity Removal
  • Custom Workflow Builder (CWB)
    • CWB Webhook
    • CWB External API
      • Retrieve CWB History
      • Retrieve CWB Responses
      • Retrieve CWB Report
  • Youverify OS Error Codes
  • Webhooks
    • Know Your Customer Webhooks
      • Identity Verification
      • Address Verification
    • Know Your Transaction Webhooks
      • Customer Management Webhooks
        • Client Created
        • Client Updated
      • Alert Service Webhooks
        • Alert Created
        • Alert Triage Created
        • Alert Updated
      • Evaluation Webhooks
        • Evaluation Completed
        • Evaluation Started
        • Transaction Updated
  • Test Data
  • Our Legacy API and SDK
Powered by GitBook
On this page
  • Installation
  • Usage
  • Tasks
  • Liveness Data
  • Credits

Was this helpful?

  1. Know Your Customer Services (KYC)
  2. ID Document Verification (SDK)
  3. iOS SDK

Youverify Liveness iOS SDK

Our iOS SDK enables seamless integration of real-time liveness detection into your mobile applications. To get started with our SDK, follow the guide below:

Last updated 1 month ago

Was this helpful?

Installation

The Installation Step should be:

For iOS 13 and later:

pod 'YouverifyLivenessSDK'

For iOS 12 and earlier:

pod 'YouverifyLivenessSDKCompat'

Example Podfile for iOS 12 and earlier:

platform :ios, '11.0'
use_frameworks!

target 'YourApp' do
  pod 'YouverifyLivenessSDK'  # Use this for iOS 13+
  # pod 'YouverifyLivenessSDKCompat'  # Uncomment this for iOS 12 and below
end

After saving the changes to your Podfile, run the following command in Terminal:pod install

Usage

  1. Import the package into your web page like so:

import YVLivenessSDK
  1. Initialize an instance of the package, like so:

@StateObject var yvLiveness: IosSDK

_yvLiveness = StateObject(wrappedValue: IosSDK(options))

For a list of the valid options, check this out

  1. Start the process, like so:

yvLiveness.startSDK();

This could also be called with an array of tasks. The supplied tasks override those provided during initialization.

let livenessTasks = [
    TaskProperties(task: 
        YVTask.completeTheCircle(CompleteTheCircleTask(difficulty: .medium))
    )
]

yvLiveness.startSDK(tasks: livenessTasks)
  1. Add the SDKView to your page, and the controls for the modal as so:

if iosSDK.isDialogVisible {
    SDKView(
        sdk: iosSDK
    )
}

Full Example:

@StateObject var iosSDK: IosSDK

init() {
    _iosSDK = StateObject(wrappedValue: IosSDK(
        publicKey: "PUBLIC_KEY",
        user: SDKUser,
        onSuccess: {data in
            print("The data returned is \(data)")
        }
    ))
}

Button(action: {
    iosSDK.startSDK(tasks: [
        TaskProperties(task: 
            YVTask.completeTheCircle(CompleteTheCircleTask(difficulty: .medium))
        )
    ])
}) {
    Text("Complete the Circle")
}

if iosSDK.isDialogVisible {
    SDKView(
        sdk: iosSDK
    )
}

Options

Option
Type
Required
Description
Default Value
Possible Values

sandboxEnvironment

Boolean

No

Sets whether session should run in sandbox or live mode

true

true, false

tasks

Array

No

NoSets tasks that need to be performed for liveness to be confirmed

nil

user

Class

Yes

Sets details of user for which liveness check is being performed

-

Any string

user.firstName

String

Yes

First name of user

-

Any string

user.lastName

String

No

Last name of user

nil

Any string

user.email

String

No

Email of user

nil

Any string

onClose

Function

No

Callback function that gets triggered when modal is closed

nil

Any valid function

onSuccess

Function

No

nil

Any valid function

onFailure

Function

No

nil

Any valid function

Tasks

A task is a series of instructions for users to follow to confirm liveness. Find below a list of tasks.

PS: We aim to frequently add to this list a variety of fun and yet intuitive ways of confirming liveness, so be on the lookout for more tasks!

They are:

Complete The Circle

User passes task by completing imaginary circle with head movement.

CompleteTheCircleTask option

Option
Type
Required
Description
Default Value
Possible Values

difficulty

TaskDifficulty

No

Sets difficulty of task

.medium

.easy, .medium, .hard

timeout

Number

No

Sets time in milliseconds after which task automatically fails

nil

Any number in milliseconds

Yes Or No

User passes task by answering a list of arbitrary questions set by you with the tilting of the head; right for a yes and left for a no.

YesOrNoTask option

Option
Type
Required
Description
Default Value
Possible Values difficulty

difficulty

TaskDifficulty

No

Sets difficulty of task

.medium

.easy, .medium, .hard

timeout

Number

No

Sets time in milliseconds after which task automatically fails

nil

Any number in milliseconds

questions

Array

No

A set of questions to ask user

nil

See nested options below

questions.question

String

Yes

Question to ask user. Should be a true or false type question. Eg: "Are you ready"

-

Any string

questions.answer

Bool

Yes

Answer to the question

-

true, false

questions.errorMessage

String

No

Error message to display if user gets question wrong

undefined

Any string

Motions

User passes task by performing random motions in random sequences, which include nodding, blinking and opening of mouth.

MotionsTaskClass option

Option
Type
Required
Description
Default Value
Possible Values

difficulty

TaskDifficulty

No

Sets difficulty of task

.medium

.easy, .medium, .hard

timeout

TimeInterval

No

Sets time in milliseconds after which task automatically fails

nil

Any number in milliseconds

maxNods

Int

No

Maximum amount of nods a user is asked to perform

5

Any number

maxBlinks

Int

No

Maximum amount of nods a user is asked to perform

5

Any number

TaskProperties

User passes in the class and preferred settings for each task.

Option
Type
Required
Description
Default Value
Possible Values

task

YVTask

Yes

Id of task

-

YVTask.completeTheCircle(Task_class eg. CompleteTheCircleTask)

timeout

TimeInterval

No

Sets time in milliseconds after which task automatically fails

nil

Any number in milliseconds

Liveness Data

The onSuccess and onFailure callbacks (if supplied) are passed the following data:

Option
Type
Description

data

Object

Data passed through callback

data.faceImage

String

Face Image of user performing liveness check

data.livenessClip

String

Video of user performing liveness check

data.passed

Bool

Indicator on whether liveness check passed or failed

data.metadata

Any

Metadata passed in during initialization

Credits

Callback function that gets triggered when all tasks have been completed and passed. Called with completion

This SDK is developed and maintained solely by

Get your Public Merchant Key
Youverify
data

See

Callback function that gets triggered when at least one task fails. Called with completion

tasks
data