Skip to main content

Get started

This page demonstrates how to configure your account to use the SDK, as well as how to install and configure it in your project.

Before you begin

Before you start, make sure that your development environment meets the following requirements:

Installation

Using Flutter CLI

Use the following command in flutter cli to add the SDK to your project:

$ flutter pub add unico_check

The command above adds the following line in your pubspec.yaml file.

dependencies:
unico_check: ^2.0.2
Manually get the packages

The command flutter pub add unico_check implicitly triggers command flutter pub get. If package is not correctly installed, make sure that you have unico_check in you pubspec.yamlfile, and manually run flutter pub get.

Declare app permissions

In order to use user's camera, include the following user permissions in your app:

<key>NSCameraUsageDescription</key>
<string>Camera usage description</string>

Including dependencies

Now you just need to correctly import the SDK into your project. You just need to import it in your Dart file.

main.dart

import 'package:unico_check/unico_check.dart';

Get your credentials

  1. Log in to the Unico Customer Area;
  2. Go to Configurações (Configurations), then Integração (Integrations) and finally to API Key;
  3. Generate or edit an existing API Key;
  4. If you want to use the Smartlive with interaction functionality in your app, check if the field "Utiliza liveness com interação" is enabled (this field must be showing you the word "SIM"). Otherwise, contact the support team to request the activation.
Smartlive with interaction

Learn more about Smartlive with interaction in the key concepts section.

  1. Select SIM (Yes) in the field "Utiliza autenticação segura na SDK" (Asking if use secure authentication in SDK);
  2. Expand the Android iOS section and add your Android application name and Bundle ID;
  3. Save your changes.
  4. Repeat the procedures 1 to 7 to create another key to your Android App.

Add the credentials to your app

  1. Log in to your Customer Area;

  2. Go to Configurações (Configurations), then Integração (Integrations) and finally to API Key;

  3. Select the Download option on the desired API Key;

  4. Select the iOS option;

  5. Click on "Gerar" (Generate) and a new tab opens in your browser containing project information in JSON format.

  6. Save the content of this new tab in a JSON file;

  7. Repeat the procedures 1 to 6 to your Android App.

  8. Keep the files to add it in your project latter. This configuration is explained latter in this SDK guides.

Problems with pop-up blockers

You may need to temporarily disable your pop-up blocker to see the download window.

Configure the credentials in your app

To configure your credentials, use the data from the JSON files downloaded in the step above to instantiate the interface UnicoCheck:

JSON file with your credentials
{
"project_info":{
"project_number":"<YOUR_PROJECT_NUMBER>",
"project_id":"<YOUR_PROJECT_ID>"
},
"client_info":{
"mobilesdk_app_id":"<YOUR_MOBILE_SDK_APP_ID>",
"ios_client_info":{
"bundle_identifier":"<YOUR_MOBILE_BUNDLE_IDENTIFIER>"
}
},
"host_info":{
"host_info":"<YOUR_HOST_INFO>",
"host_key":"<YOUR_HOST_KEY>"
}
}

Implementation example:

main.dart
  final _configIos = UnicoConfig(
getProjectNumber: "Your ProjectNumber Ios",
getProjectId: "Your ProjectId Ios",
getMobileSdkAppId: "Your MobileSdkAppId Ios",
getBundleIdentifier: "Your BundleIdentifier Ios",
getHostInfo: "Your HostInfo Ios",
getHostKey: "Your HostKey Ios");

final _configAndroid = UnicoConfig(
getProjectNumber: "Your ProjectNumber Android",
getProjectId: "Your ProjectId Android",
getMobileSdkAppId: "Your MobileSdkAppId Android",
getBundleIdentifier: "Your BundleIdentifier Android",
getHostInfo: "Your HostInfo Android",
getHostKey: "Your HostKey Android");

@override
void initState() {
super.initState();
initUnicoCamera();
configUnicoCamera();
}

void initUnicoCamera() {
_unicoCheck = new UnicoCheck(
listener: this,
unicoConfigIos: _configIos,
unicoConfigAndroid: _configAndroid);
}

Getting help

Are you missing something or still need help? Please, please get in touch with the support team at help center.

Next steps