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:
- Flutter Developer SDK installed;
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
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.yaml
file, 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.
import 'package:unico_check/unico_check.dart';
Get your credentials
- Log in to the Unico Customer Area;
- Go to Configurações (Configurations), then Integração (Integrations) and finally to API Key;
- Generate or edit an existing
API Key
; - 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.
Learn more about Smartlive with interaction in the key concepts section.
- Select SIM (Yes) in the field "Utiliza autenticação segura na SDK" (Asking if use secure authentication in SDK);
- Expand the Android iOS section and add your Android application name and Bundle ID;
- Save your changes.
- Repeat the procedures 1 to 7 to create another key to your Android App.
Add the credentials to your app
Log in to your Customer Area;
Go to Configurações (Configurations), then Integração (Integrations) and finally to API Key;
Select the Download option on the desired API Key;
Select the iOS option;
Click on "Gerar" (Generate) and a new tab opens in your browser containing project information in JSON format.
Save the content of this new tab in a JSON file;
Repeat the procedures 1 to 6 to your Android App.
Keep the files to add it in your project latter. This configuration is explained latter in this SDK guides.
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
:
{
"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:
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
- Learn how to capture selfies with the SDK.
- Learn how to capture image of documents with the SDK.
- Learn more about the SDK in the Reference documentation.
- Check the REST APIs documentation.