LogoLogo
  • Welcome!
  • GETTING STARTED
    • Signing Up
    • Choose a Product
    • Choose an Integration Option
    • Run Your First Test Job
    • Complete Your KYC
    • Fund Your Wallet
    • Go Live!
    • Pricing
  • SUPPORTED ID TYPES & DOCUMENTS
    • For Individuals (KYC)
      • Using ID Number
        • Supported Countries
          • Côte d'Ivoire
            • National ID (without Photo)
            • Resident ID (without Photo)
          • Ghana
            • Ghana Card
            • Passport
            • Voter's ID
          • Kenya
            • Alien Card
            • KRA Pin
            • National ID
            • National ID (without Photo)
            • Passport
            • Tax Information
          • Nigeria
            • Bank Account
            • BVN
            • NIN V2
            • NIN Slip Verification
            • V_NIN (Virtual NIN)
            • Phone Number
            • Voter's ID
          • South Africa
            • National ID
            • National ID (without Photo)
            • Phone Number
          • Uganda
            • National ID (without Photo)
            • Basic KYC in Uganda
          • Zambia
            • Bank Account
            • TPIN
          • Zimbabwe
            • National ID (without Photo)
        • Test Data
          • Customising Sandbox Test Data
        • ID Number Regex
        • Visual Samples of Supported ID Types
      • Using Document Image
        • Continents
          • Africa
          • Asia and the Middle East
          • Europe
          • North America
          • Oceania
          • South America
    • For Businesses (KYB)
      • Supported Countries
        • Nigeria
          • Business Registration
          • Tax Information
        • Kenya
          • Business Registration
        • South Africa
          • Business Registration
      • ID Number Regex
  • PRODUCTS
    • For Individuals (KYC)
      • AML Check
        • AML News Media
      • Basic KYC
      • Biometric KYC
      • Digital Address Verification
      • Document Verification
        • Document Verification
        • Enhanced Document Verification
      • Electronic Signature
      • Enhanced KYC
      • Phone Number Verification
      • SmartSelfie™ Authentication
      • SmartSelfie™ Compare
      • Smile Secure
    • For Businesses (KYB)
      • Business Verification
  • Integration Options
    • Mobile
      • Getting Started
      • Products
        • Biometric KYC
        • BVN Consent
        • Document Verification
        • Enhanced Document Verification
        • Enhanced KYC
        • SmartSelfie™ Enrollment and Authentication
        • Enhanced SmartSelfie™ Enrollment And Authentication
      • Customization
        • UI Components
      • Offline Mode
      • Release Notes
        • Android Release Notes
        • iOS Release Notes
        • Flutter Release Notes
        • React Native Release Notes
    • No-Code
      • Smile Links
        • Link FAQs
        • Rest API
    • Server to Server
      • Ruby
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
          • KYB - Business Verification
          • AML Check
        • Generate Token for Web Integration
        • Utilities
      • Python
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
          • Business Verification
        • Generate Token for Web Integration
        • Utilities
      • Java
        • Release Notes
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
        • Generate Token for Web Integration
        • Utilities
      • Node.js
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • Enhanced Document Verification
          • SmartSelfie™ Authentication
          • Business Verification
        • Generate Token for Web Integration
        • Utilities
      • PHP
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
        • Generate Token for Web Integration
        • Utilities
    • Rest API
      • Signing your API Request
        • Using Signature
      • Products
      • Postman Collection
      • Utilities
    • Web / Mobile Web
      • Web Integration
        • Installation
        • Usage
        • End User Consent
        • Support
      • Javascript SDK
        • Installation
        • Usage
        • Migration
        • Deprecated Version
          • Installation
          • Usage
          • Notes
          • Support
  • FURTHER READING
    • FAQs
      • What are your support hours?
      • How do I set up a callback?
      • How to re-enroll, deactivate or delete a user?
      • Add or remove team members
      • What are top-level keys?
      • What are partner_params?
      • How do job types map to the new product names?
      • Is there an API I can use to monitor my wallet balance?
      • Is there an API I can query to check the availability status of an ID type?
      • How do I integrate Smile ID in other countries or query other ID types?
      • What are the image types I can upload to Smile ID?
      • Why aren't Kenyan IDs returning images for some IDs queried?
      • Why are some of my bank verification requests returning 'ID authority unavailable'?
      • How can I look up a specific user's data?
      • Selfie best-practices
      • Document capture best-practices
      • What happens under the hood?
      • Guide to the user consent screen
      • What is code 2302?
      • Using the Demo App and Scanning QR codes
    • Job status
    • KYC receipts
    • Result codes
      • Error codes
    • Securing your account with two-factor authentication (2FA)
    • Security Overview
    • Troubleshooting
      • Troubleshooting error 2204 & 2205 - "You're not authorized to do that"
      • Why is my Web API job taking so long?
      • Image capture issues on web client
Powered by GitBook
On this page

Was this helpful?

  1. Integration Options
  2. Mobile
  3. Products

Biometric KYC

Perform a Biometric KYC Job

Biometric KYC is exposed as a flow which performs the following high level steps:

  1. Displays instructions to the user

  2. Requests camera permissions (if not already granted)

  3. Captures and saves Liveness and Selfie images

    1. useStrictMode defaults to false and will use Smile Smartselfie™ capture screens for selfie

    2. If useStrictMode is set to true the selfie capture use Enhanced SmartSelfie™ capture

  4. Submits the job to the Smile ID API

  5. Delivers the result back to the caller

Consent Information

Some ID Types may require consent to be granted. In such cases the consent information would expect the below so this is completely optional and the SDK will default to false and consent time will be the time of execution

consentGrantedDate. // The date consent was granted defaults to the time of screen initialisation
personalDetailsConsentGranted // If the user has granted personal details consent defaults to false
contactInfoConsentGranted // If the user has granted contact information consent defaults to false
documentInfoConsentGranted // If the user has granted document information consent defaults to false

If the user has granted consent personalDetailsConsentGranted, contactInfoConsentGranted, documentInfoConsentGranted can all be set to true

Java has no named parameters so when using fragments instantiate the consent with the consent grant date in iSO format and all other values set to false.

@Composable
fun BiometricKYCExample(idInfo: IdInfo) {
    SmileID.BiometricKYC(
        idInfo = idInfo,
        consentInformation =
        ConsentInformation(
            consentGrantedDate = getCurrentIsoTimestamp(), // date in iso string format for when user granted consent
            personalDetailsConsentGranted = false, // set true if user has agreed to personal details, will default to false
            contactInfoConsentGranted = false, // set true if user has agreed to contact information, will default to false
            documentInfoConsentGranted = false, // set true if user has agreed to document information, will default to false
        ),
        useStrictMode = true, // true if you want to capture using enhanced SmartSelfie™ capture) { result ->
        onResult = { result ->
            when (result) {
                is Success -> {
                    // val resultData = result.data
                    // Log.d("BiometricKYC", "Success: $resultData")
                    // ...
                }

                is Error -> {
                    // There was an error (could be denied camera permissions, network errors, etc)
                    // val throwable = result.throwable
                    // Log.w("BiometricKYC", "Failure: $it", throwable)
                }
            }
        },
    )
}
IdInfo idInfo = new IdInfo(...);
BiometricKYCFragment biometricKycFragment = BiometricKYCFragment
    .newInstance(idInfo);
getSupportFragmentManager().setFragmentResultListener(
    BiometricKYCFragment.KEY_REQUEST,
    this,
    (requestKey, result) -> {
        SmileIDResult<BiometricKYCResult> biometricKycResult =
            BiometricKYCResult.resultFromBundle(result);
        Timber.v("BiometricKYC Result: %s", biometricKycResult);
        getSupportFragmentManager()
            .beginTransaction()
            .remove(biometricKycFragment)
            .commit();
        hideProductFragment();
    }
);
import SwiftUI
import SmileID

struct MyView: View, BiometricKycResultDelegate {
    @State private var idInfo: IdInfo
    var body: some View {
        ZStack {
            SmileID.biometricKycScreen(
                idInfo: idInfo,
                consentInformation: ConsentInformation(
                    consentGrantedDate: "date consent granted", // date in iso string format for when user granted consent
                    personalDetailsConsentGranted: false, // set true if user has agreed to personal details, will default to false
                    contactInformationConsentGranted:  false,// set true if user has agreed to contact information, will default to false
                    documentInformationConsentGranted: false // set true if user has agreed to document information, will default to false
                ),
                useStrictMode : true, // true if you want to capture using enhanced SmartSelfie™ capture
                delegate: self
            )
        }
    }
    
    func didSucceed(selfieImage: URL, livenessImages: [URL], didSubmitBiometricJob: Bool) {
        print("Successfully submitted Biometric KYC job")
    }
    
    func didError(error: Error) {
        print("An error occurred - \(error.localizedDescription)")
    }
}
let biometricKycScreen = SmileID.biometricKycScreen(...)
let controller = UIHostingController(rootView: biometricKycScreen)
controller.modalPresentationStyle = .fullScreen
navigationController?.present(controller, animated: true)
Navigator.of(context).push( //Requires Navigator.of(context).push in order to load
    MaterialPageRoute<void>(
        builder: (BuildContext context) => Scaffold(
            appBar: AppBar(title: const Text("SmileID Biometric KYC")),
            body: SmileIDBiometricKYC(
                country: "KE",
                idType: "NATIONAL_ID",
                idNumber: "12345678",
                showInstructions: true, //Show the instruction screen
                useStrictMode: true, // true if you want to capture using enhanced SmartSelfie™ capture (will invalidate the above)
                consentGrantedDate : DateTime.now().toIso8601String(), // date in iso string format for when user granted consent
                personalDetailsConsentGranted = false, // set true if user has agreed to personal details, will default to false
                contactInformationConsentGranted = false, // set true if user has agreed to contact information, will default to false
                documentInformationConsentGranted = false, // set true if user has agreed to document information, will default to false
                onSuccess: (String? result) {
                    // Your success handling logic
                    final snackBar = SnackBar(content: Text("Success: $result"));
                    ScaffoldMessenger.of(context).showSnackBar(snackBar);
                    Navigator.of(context).pop(); //Return flow to your app
                },
                onError: (String errorMessage) {
                    // Your error handling logic
                    final snackBar = SnackBar(content: Text("Error: $errorMessage"));
                    ScaffoldMessenger.of(context).showSnackBar(snackBar);
                    Navigator.of(context).pop(); //Return flow to your app
                },
            ),
        ),
    ),
);
<SmileIDBiometricKYCView
  allowAgentMode={false} // true if you need to use the secondary camera
  allowGalleryUpload={false} //true if document can be uploaded from gallery
  captureBothSides={true} // true if capturing back and front of document
  showInstructions={true} // show instructions before capture
  useStrictMode={true} // true if you want to capture using enhanced SmartSelfie™ capture (will invalidate the above)
  idInfo={{
    country: "<country code>",
    idType: "<id type>",
    idNumber: "<id number>",
    entered: true,
  }}
  consentInformation ={
      {
          consentGrantedDate: new Date().toISOString(),  // date in iso string format for when user granted consent
          personalDetailsConsentGranted: true,  // set true if user has agreed to personal details, will default to false
          contactInfoConsentGranted: true, // set true if user has agreed to contact information, will default to false
          documentInfoConsentGranted: true, // set true if user has agreed to document information, will default to false
      }
  }
  style={{ width: '100%', height: '100%' }} //fill the entire view
  onResult={(event) => {
    setResult(event.nativeEvent.result);
  }}
/>

On onResult, you will receive a JSON string following the structure:

{
  "selfieFile": "<path to selfie file>",
  "livenessFiles": [
    "<path to liveness file>",
    "<path to liveness file>",
    ...
    "<path to liveness file>",
  ],
  "didSubmitBiometricKycJob": true
}
PreviousProductsNextBVN Consent

Last updated 2 months ago

Was this helpful?

Note: Recommend wrapping this in a component that can be navigated to and out of view due to a known issue with views displaying dialogs particularly on failure and the dialog keeps showing,

⚠️