Flutter SDK Integration Guide
Welcome to the Flutter SDK integration guide. Follow these steps to seamlessly integrate our Digital Identity solution through our Flutter SDK for secure and efficient validation of your users by identity flows.
Prerequisites
-
Account Creation: In order to perform an integration in any of our services, you must have a Truora account. Your Truora sales representative will provide you with one. To log into your existing account, go to https://account.truora.com/#/auth/login.
-
Create a Truora API Key: In order to perform an integration in any of our services, you must have a Truora API key. Follow this guide to create your Truora API key.
-
Create a Digital Identity Web Flow: For instructions on how to create a Web Flow, please refer to the Digital Identity Verification Flow guide.
-
Create a Web Integration Token: For instructions on how to generate a token, please refer to the How to create a Web Integration Token guide.
Flutter SDK Documentation
Truora provides a Flutter plugin that simplifies the integration of our Digital Identity (DI) solution into your applications. This package offers the necessary classes and protocols to initiate identity verification processes and efficiently manage the results.
Setup
Integrating the Truora SDK into a Flutter project is quick and straightforward. It is available for installation via pub.dev for easy setup. For more information, visit the Truora SDK for Flutter project.
-
Create a new Flutter project by running the following command:
Create App -
Add the Truora SDK dependency. Navigate to the project directory and add the Truora SDK dependency:
Add Dependency
iOS Configuration
To properly configure your iOS application, make the following adjustments:
- Modify
info.plist
:
Add the necessary permissions based on the verifications you will use:
-
For camera verifications, add:
Camera Verifications -
For geolocation verifications, add:
Geolocation Verifications -
For document verification that requires uploading files from the gallery, add:
Document Verifications
- Update
Podfile
:
In your ios/Podfile, include the following code to manage permissions:
Note: Only add the permissions that your application will use.
- Update
Pods
:
Run the following command to update your pods:
Android Configuration
To configure your Android application, modify AndroidManifest.xml
by adding the necessary permissions:
-
Camera Verification:
Camera Verification -
Geolocation Verification:
Geolocation Verification -
Document Verification (Gallery Upload):
Document Verification
How to Use
In your build()
method, configure the TruoraSDK
widget with the necessary properties:
- token: This is the API token used to authorize and start the identity verification process.
- requiredPermissions: A list of permissions that the SDK requires. Possible permissions include:
TruoraPermission.camera
: Access to the camera for identity verification.TruoraPermission.location
: Access to location for geolocation verification.TruoraPermission.photos
: Access to the gallery for document verification.
Callback Functions
The TruoraSDK
allows you to handle various events:
- onError: Triggered if an error occurs during the process.
- onStepsCompleted: Invoked once the identity verification steps are completed.
- onProcessSucceeded: Triggered if the identity verification is successful.
- onProcessFailed: Called if the identity verification fails.
Example Code
Here’s an example of how to implement the TruoraSDK in your widget:
Example Application
You can review our sample Flutter application, which serves as a comprehensive guide for utilizing the SDK, at the following link: