Flutter

Flutter VoveSDK Documentation

Introduction

The Flutter VoveSDK plugin facilitates easy integration of ID verification and KYC (Know Your Customer) compliance into mobile applications, supporting both iOS and Android platforms. This wrapper abstracts the complexity of interacting with the native VoveSDK, providing a simplified, Future-based Dart API for Flutter developers.

Installation

To include the Flutter VoveSDK in your project, add it to your pubspec.yaml:

dependencies:
  vove_id_flutter: ^1.1.0

This package comes bundled with all necessary native dependencies, so there's no need for additional modifications to your iOS or Android project files.

Usage

The core functionality of the VoveSDK is to perform ID verification through a straightforward function call, which manages the verification process based on a session token and environment setting.

Initializing the Vove SDK in Flutter

To initialize the Vove SDK, use your public API key. This setup should ideally be done in the main.dart file as early as possible in the app's lifecycle.

import 'package:vove_id_flutter/vove_id_flutter.dart';

Vove.initialize(
    environment: VoveEnvironment.sandbox,
    publicKey: "YOUR_PUBLIC_KEY_HERE",
)

Starting ID Verification

To start the ID verification process, use the start function. This function requires a configuration object which includes the environment, session token, and optional settings such as vocal guidance and locale. It returns a Future that completes to indicate the verification outcome.

Function Signature

Future<String> start({
    required String sessionToken,
    bool? enableVocalGuidance,
    VoveLocale? locale,
}) async   
  • environment: Specifies the environment for the SDK to operate in. Can be VoveEnvironment.production or VoveEnvironment.sandbox.

  • sessionToken: A token generated by your backend, used to initiate the ID verification session.

  • enableVocalGuidance: Optional boolean to enable vocal guidance during the verification process.

  • locale: Optional locale setting for localizing the verification process (see below for details).

Example Usage

import 'package:vove_id_flutter/vove_id_flutter.dart';

void startVerification() async {
  try {
    final result = await Vove.start(
      sessionToken: 'your_session_token_here',
      enableVocalGuidance: true,
      locale: VoveLocale.en,
    );
    
    switch (result) {
      case 'success':
        print('Verification successful.');
        break;
      case 'pending':
        print('Verification pending.');
        break;
      case 'canceled':
        print('Verification canceled.');
        break;
      default:
        print('Unexpected status: $result');
    }
  } catch (error) {
    print('Verification failed: $error');
  }
}

Handling Verification Results

The Future returned by start function will:

  • Complete with a status string for "success", "pending", or "canceled" scenarios, indicating the verification outcome.

  • Throw an exception in the case of a "failure", providing an error message detailing the failure reason.

Localization with VoveLocale

The SDK supports multiple languages for ID verification processes. To use this feature, specify the locale when starting the verification:

  • VoveLocale.en: English

  • VoveLocale.fr: French

  • VoveLocale.ar: Arabic

  • VoveLocale.arMA: Moroccan Arabic

Enabling Vocal Guidance

To enhance the user experience during ID verification, vocal guidance can be enabled. Set the enableVocalGuidance parameter to true. This feature is especially useful for helping users through the verification process in a clear and guided manner.

Troubleshooting

Ensure the session token is correctly generated and passed, and that the appropriate environment is selected based on your application's stage (development or production). For unresolved issues, contact support with detailed information about the problem, including error messages and the steps leading up to the issue.

Support

For further assistance or inquiries about the Flutter VoveSDK plugin, please reach out to our support team.

Last updated