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
  • Selfie Capture
  • Import the package
  • Capture Selfie
  • Get Results
  • Optional Permissions
  • Optional UI Customisations
  • Selfie Capture Screen Customisation
  • Selfie Review Screen Customisation
  • Basic Example

Was this helpful?

  1. Integration Options
  2. Mobile
  3. Flutter (deprecated)

Selfie Capture

Selfie Capture will capture a selfie for a tag that may be provided during initiation and if not provided this will be auto generated by the SDK and returned with a code.

Last updated 11 months ago

Was this helpful?

Selfie Capture

Selfie Capture will capture a selfie for a tag that may be provided during initiation and if not provided this will be auto generated by the SDK and returned with a code.

Import the package

import 'package:smile_flutter/smile_flutter.dart';

Capture Selfie

If you want the SDK to generate a tag for you then call the method with an empty string

 var result = await SmileFlutter.captureSelfie("")

If you want the generate to use a custom tag send a string to the SDK with alphanumeric characters with the exception of an underscore and no spacing in them.

 var result = await SmileFlutter.captureSelfie(<STRING_TAG>)

This will present a screen as below:

Get Results

The selfie capture process is an asynchronous process and will return an error code and a tag once done. The result looks as the below

    var resultCode = result["SID_RESULT_CODE"];
    var resultTag = result["SID_RESULT_TAG"];

If the result code is -1 AND the tag is not null or empty then the selfie capture was successful.

Optional Permissions

By default the SDK will request for permissions on it's own particularly on android and the first instance the call to the captureSelfie may fail and will definately fail if the user has not allowed the permissions for camera

It is advisable to then do permissions request prior to calling the captureSelfie method to make sure you handle permissions and perhaps even check for permissions before in that case then the call should be

var result = await SmileFlutter.captureSelfie("", HashMap<String, String>(),false)

The false will mean the SDK will try to open the selfie capture and assume permission handling has already been done

Optional UI Customisations

For basic UI customisation, an additional key-value Object needs to be passed as second parameter when performing a call to the library's captureSelfie("<TAG>",HashMap<String, String>(),false)

) method, where tag is a string and config the added key-value Map containing the desired settings.

Selfie Capture Screen Customisation

  • overlay_color: a 7-character (no alpha channel) hexadecimal colour string (ie. #FF0000 for red) that sets the background color for the oval overlay view in the selfie capture screen

  • overlay_alpha: an integer value ranging from 0 to 255 that controls the transparency of the oval overlay view in the selfie capture screen

  • overlay_thickness: an non-bound double value that determines the thickness of the oval overlay's line

  • overlay_dotted: a boolean value that specifies whether the oval overlay's line should dotted or plain (the latter by default).

  • overlay_width: a non-bound double value that sets the oval shape's width in the selfie capture screen

  • overlay_height: same as the above, for the oval shape's height

  • capturing_progress_color: a 7-character (no alpha channel) hexadecimal colour string (ie. #FF0000 for red) that determines the colour of the oval overlay during selfie capture

  • captured_progress_color: a 7-character (no alpha channel) hexadecimal colour string (ie. #FF0000 for red) that determines the colour of the oval overlay after selfie capture

  • prompt_default_text: a string that determines the default text when the selfie capture view is initialise; this refers to text view directly under the selfie capture view

  • prompt_blurry_text: a string that informs the user that selfie is blurry

  • prompt_capturing_text: a string that informs the user that the selfie capture operation is underway

  • prompt_do_smile_text: a string used to prompt the user to smile

  • prompt_compatibility_mode_text: a string for compatibility-related issue

  • prompt_face_not_found_text: a string that determines the error message when the face is not found during selfie capture

  • prompt_face_too_close_text: a string that informs the user that they're positioned outside the acceptable selfie capture distance range

  • prompt_idle_text: a string that informs the user that the selfie capture has remained idle for long

  • prompt_move_closer_text: a string that prompts the user to move closer to the camera during selfie capture

  • prompt_too_dark_text: a string used to notify the user that brightness and light intensity is low

  • capture_tip_text: a string used for the tips at the bottom of the selfie capture screen

Selfie Review Screen Customisation

  • review_title_text: a string value for the selfie review screen's title.

  • review_prompt_text: a string that determines the prompt text view on the selfie review screen; this text view refers to the one directly under the selfie image view

  • review_tip_text: a string used for the tips at the bottom of the selfie capture screen

  • review_confirm_text: a string value for the confirm button (positive action)'s text

  • review_confirm_color: a 7-character (no alpha channel) hexadecimal colour string (ie. #FF0000 for red) that determines the the confirm button's background colour

Basic Example

var config = HashMap<String, String>();
config["capture_title_text"] = "Capturing your smile..."";
var result = await SmileFlutter.captureSelfie("", config) ?? null;

capture_title_text: a string value for the selfie capture screen's title. Refer to .

review_prompt_style: a key-value Object that determines the styling for the prompt text view (the text view directly under the the selfie image view)'s styling - similar to

review_tip_style: a key-value Object that sets the styling for the tips text view (the text view directly under the prompt text view in the selfie review screen)'s styling - similar to

Strings and Colours section for details
screen_title_style
screen_title_style
Selfie Capture Screen