Nesta seção, você encontrará todas as informações necessárias pra implementar o SDK Flutter da plataforma Unico IDCloud
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
In this section, you will find all the information necessary for customizing the SDK of the Unico IDCloud platform in your Flutter applications
The Flutter SDK allows for some customizations to be made. Below are all the possible customizations for this SDK.
It is possible to configure the experience of the informational messages in the capture frames by changing their language. Use the enumerated type LocaleTypes
, which contains the following values:
LocaleTypes.PT_BR
: for Portuguese(Brazil);
LocaleTypes.ES_MX
: for Spanish(Mexico);
LocaleTypes.ES_ES
: for Spanish(Spain);
LocaleTypes.EN_US
: for English(USA).
See how to implement it in the example below:
A remote activation may be required to be used, if you wish to use it, notify your project manager or Unico support.
If not configured, the SDK will use Portuguese as the default language.
This is an optional step, but it is highly recommended to give the capture process the visual identity of your company. You can customize some objects in the frame according to the camera mode used through the setTheme()
method.
The supported types for color representation are Color Resource or a String containing the hexadecimal color code. E.g., R.color.red
or #FF0000
.
All methods are available below:
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
Method |
---|
getColorSilhouetteError()
getColorSilhouetteNeutral()
getColorBackground()
getColorBoxMessage()
getColorTextMessage()
getColorBackgroundPopupError()
getColorBackgroundButtonPopupErrorgetColorTextPopupError()
getColorBackgroundButtonPopupError()
getColorTextButtonPopupError()
getColorBackgroundTakePictureButton()
getColorIconTakePictureButton()
getColorBackgroundBottomDocument()
getColorTextBottomDocument()
In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your Flutter applications
In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your Flutter applications for selfie capture
This guide has been designed to help you quickly and easily implement the Flutter SDK. Below, you'll find the step-by-step process for the complete integration. If you wish to customize the experience further, check out the Flutter Customization section.
To get started, create an instance of the builder (generated through the UnicoCheckBuilder interface) by providing the relevant context and the implementation of the UnicoListener class as parameters. The implementation of this class is quite simple and can be done in just a few lines of code. All you need to do is override the callback methods with the business logic of your application.
Configure the environment that will be used to run the SDK. Use the enumerated environment that contains the following enumerates:
UnicoEnvironment.PROD
: for production environment;
UnicoEnvironment.UAT
: for approval environment.
See how to implement it in the example below:
Note that implementing the AcessoBioListener
class is largely about setting up callback methods. Each method is triggered in a specific SDK return scenario. Override the methods exemplified above with your application’s business logic.
onErrorUnico(UnicoError error)
This method is invoked whenever any implementation error occurs using any SDK method. It receives an ErrorBio
parameter that contains error details. See the Error Handling section for more about ErrorBio
.
onUserClosedCameraManually()
This method is invoked when the user manually closes the camera, such as by clicking the "Back" button.
onSystemClosedCameraTimeoutSession()
This method is invoked when the maximum session time is reached (without capturing an image).
You can configure the session timeout in seconds using setTimeoutSession
. The default and minimum timeout is 40 seconds.
onSystemChangedTypeCameraTimeoutFaceInference()
This method is invoked when the maximum time for face detection is reached without detection.
The maximum time is 13 seconds. The mode is then switched to manual capture to facilitate the user’s action.
All the above methods must be created as indicated in your project (even without any logic); otherwise, the project won’t compile successfully.
The SDK is preconfigured with intelligent framing and automatic capture. Configure the camera mode in the builder as follows:
The false/true
values in the above methods do not alter the capture experience; they are solely used for the SDK's internal logic.
mplement these listener methods using an instance of the UnicoSelfie
class.
The camera opening method, which is called in the next step, needs to know what to do when an image is successfully captured or if an error occurs in the process. You must specify "what to do" in the camera opening method by implementing listeners, which are triggered in success or error situations.
Through listener configuration, you can define what happens in your app in cases of an error (onErrorSelfie
method) or success (onSuccessSelfie
method) when capturing images.
onSucessSelfie
MethodUpon successful image capture, this method returns a ResultCamera
object for subsequent API requests:
The ResultCamera
object provides two attributes: base64
and encrypted
:
Use base64
for preview in the app;
Use encrypted
for sending to REST APIs.
The encrypted
attribute is strictly intended for sending the image through the by Client APIs. It should not be opened or serialized, as its characteristics may change without prior notice. Its use must be exclusive to interactions with the APIs to ensure the integrity and security of the data. Unico is not responsible for any damages arising from this practice, as modifications may occur unexpectedly.
The base64
and encrypted
files can vary in size due to several factors, including the quality of the devices and the photos generated, as well as Unico's business rules. To avoid issues in your application, do not restrict the size of the string generated by the SDK for these files in your programming logic or infrastructure.
If it is necessary to convert the base64 string to a bitmap, the standard method does not work for Android. You need to perform a split at the comma (,) for it to function correctly. If you want to learn more, read the article:How to convert a Base64 string into a Bitmap image to show it in a ImageView?.
onErrorSelfie
MethodIf an error occurs during image capture, this method returns an UnicoError
object:
Learn more about ErrorBio
types in the SDK Error Handling section.
The openCameraSelfie
method is used to open the camera. This method takes as parameters the implementation of the UnicoSelfie
class and the JSON with the credentials generated in the previous step. The following example illustrates the steps for configuring the listeners and opening the camera:
After capturing images, the next step is to send the generated encrypted
image from the SDK to the Client APIs.
For security reasons, the interval between the generation of the encrypted data and the sending through one of the available flows must be no more than 10 minutes. Submissions made beyond this period will be automatically rejected by the API.
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
In this section, you will find solutions to some common issues encountered during the integration of the Unico IDCloud SDK into your Flutter applications
The obfuscation guide aims to help developers handle obfuscation issues in their applications. The client's obfuscator may affect the SDK's functionality, and it is necessary that it does not obfuscate the SDK's code. Unico is not responsible for any obfuscation conflicts with the SDK.
Obfuscation is the process of transforming bytecode into a less human-readable form, thus making reverse engineering more difficult. This process involves removing debug information, such as variable tables and line numbers, and renaming packages, classes, and methods. When embedding the Android SDK in an application, errors may occur.
When obfuscation is performed using DexGuard, if a failure occurs, use the following rules:
When obfuscation is performed using ProGuard, if a failure occurs, use the following rules:
After the official release of Xcode 16 on September 17, 2024, we identified an issue when using the SDK on the App Store that flags the use of bitcode in two internal dependencies when using CocoaPods as the dependency manager. These are DeviceProfiling
and UnicoSdkLogger
. To avoid blocking new releases, you can follow the steps below until a permanent fix is provided in a future SDK release:
Open the Podfile
file.
Add the following lines after the post_install
command (do |installer|
) and before the last end
:
2.1. If there is existing code, insert this snippet before it;
2.2. f bitcode removal is already done manually, explicitly add the paths listed in framework_paths
;
If there is no post_install do |installer|
command in the Podfile
, add it as follows before the last end
:
Source: Bitrise, Xcode 16 release notes, Stackoverflow.
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
In this section, you will find all the necessary information for handling errors from the Unico IDCloud SDK in your Android applications
UnicoError
ObjectThis object is returned whenever an error occurs in the Flutter SDK.
Method Name | Description |
---|---|
Below is a list of possible error codes from the Flutter SDK:
Code | Description |
---|---|
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
In this section, you will find all the necessary information for using and integrating the Unico IDCloud SDK into your Flutter applications for document capture
This guide has been designed to help you implement the Flutter SDK quickly and easily. Below, you will find a step-by-step process for the entire integration. After that, if you wish to customize the experience, be sure to check the Flutter Customization section.
In this camera mode, there is a capture frame to assist the user in positioning the document correctly. Once the document is properly positioned, the user must click the button to take a photo of the document.
The SDK does not perform any validation of what is being captured.
In this camera mode, it is possible to capture the following documents:
CPF: Capture the front of the CPF;
CNH: Capture the open CNH;
CNH Front: Capture the front of the CNH;
CNH Back: Capture the back of the CNH;
RG Front: Capture the front of the RG;
RG Back: Capture the back of the RG;
Others: Capture any other document.
To get started, create an instance of the builder (generated through the UnicoCheckBuilder
interface), providing the relevant context and the implementation of the UnicoListener
class as parameters.
The implementation of this class is straightforward and can be done with just a few lines of code. All you need to do is override the callback methods with the business logic of your application.
Note that, as in the previous example, the implementation work of the UnicoListener
class is largely about configuring the callback methods. Each method is called in a specific situation based on the SDK's response.
Override the methods exemplified above with your application’s business logic.
onErrorUnico(UnicoError error)
This method is invoked with a parameter of type ErrorBio
that contains details about the error. Learn more about the ErrorBio
type in the error handling section.
onUserClosedCameraManually()
EThis method is invoked whenever the user manually closes the camera, such as by clicking the "Back" button.
onSystemClosedCameraTimeoutSession()
This method is invoked once the maximum session time is reached (without capturing any image).
You can configure the session timeout in seconds using setTimeoutSession
. The default and minimum timeout is 40 seconds.
onSystemChangedTypeCameraTimeoutFaceInference()
This method is invoked when the maximum time for face detection is reached without detection.
The maximum time is 13 seconds. The mode is then switched to manual capture to facilitate the user’s action.
All the above methods must be created as indicated in your project (even without any logic); otherwise, the project won’t compile successfully.
The implementation of these listener methods should be done through an instance of the iAcessoBioSelfie
class.
The camera open method needs to know what to do when an image is successfully captured or when an error occurs during the process. The camera's behavior is informed through the deployment of listeners, which are invoked in both success and error scenarios.
By implementing the listeners, you can specify what happens in your app in the event of an error (e.g., the onErrorDocument
method) or success (e.g., the onSuccessDocument
method) during the image capture process.
onSucessDocument
MethodWhen successfully capturing an image, this method is invoked and returns an object of type ResultCamera
, which is used later in the REST API requests:
The ResultCamera
object returns two attributes: base64
and encrypted
.
The base64
attribute can be used if you want to display a preview of the image in your app.
Both the encrypted
and base64
attributes can be sent in the REST API calls of the by Client.
If it is necessary to convert the base64 string to a bitmap, the standard method does not work for Android. You need to perform a split at the comma (,) for it to function correctly. If you want to learn more, read the article: How to convert a Base64 string into a Bitmap image to show it in a ImageView?.
onErrorDocument
MethodIf an error occurs during the image capture, this method is invoked and returns an object of typeUnicoError
:
Learn more about the types of ErrorBio
in the SDK's error handling section.
To open the camera, the openCameraDocument()
method is used. This method is made available through the object generated by an instance of the UnicoCheck
class.
This method accepts the following parameters:
A JSON file containing the credentials, generated in the credentials configuration step.
The listeners configured above.
The type of document to be captured, which can be one of the following:
If you need to capture a document for which there is no specific frame (e.g., RNE, among others), use the DocumentCameraTypes.OUTROS("descrição")
frame, which will allow you to use a generic rectangular frame to guide any capture.
Example using the open CNH:
After capturing images, the next step is to send the generated base64
image from the SDK to the Client APIs.
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
In this section, you will find all the information needed to install the Unico IDCloud platform SDK in your Flutter applications
Ensure your development environment meets the following preconditions:
The capture component provided through the Flutter SDK supports versions equal to or higher for the following technologies:
Android: 5.0 (API 21);
iOS: 11.
This SDK does not function on emulators, it is only supported on physical devices.
iOS: It is compatible with almost all devices running iOS 11.
You can check the list of these devices on Apple's official support channels.
It is compatible with the vast majority of devices running Android 5.0 (API level 21) or higher.
The table below lists the devices tested in the lab, along with the availability of vendor/manufacturer extensions. Some listed extensions may be subject to specific manufacturer APIs or SKUs. Click below to view the tested devices:
To implement the Unico IDCloud Flutter SDK in your Flutter application, follow the step-by-step instructions listed below:
To add the Unico Check Flutter SDK to your project, run the following command using the Flutter CLI:
This command adds the following line to your package's pubspec.yaml
file:
Obtaining Packages Manually: The flutter pub add unico_check
command implicitly triggers the flutter pub get
command. If the package was not installed correctly, ensure that unico_check
is in your pubspec.yaml
file and run flutter pub get
manually.
Contact the CSs and/or Onboarding team.
Request the SDK Key by entering the identifiers of your applications. Bundle Identifier for iOS, PackageID for Android and Host for WEB.
The identifiers of your applications will be linked to the SDK Key by the Unico team.
You receive your SDK Key to implement the AccessBioConfigDataSource.
Once the SDK installation is complete, proceed to the implementation by reading the following Usage and Integration Guide:
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
In this section, you will find all the updates for the Unico IDCloud Flutter SDK
Keep your Android SDK always up to date with the latest available version. Semantic versioning is used to number the versions. For more information, please refer to the article Overview.
Native SDK Update:
Android version 5.25.0
.
Native SDK Update:
Android version 5.24.0
;
iOS version 2.16.4
.
Still need help?
Parameter | Description |
---|---|
Didn't find something or still need help? If you're already a client or partner, you can reach out through our .
getCode()
Method used to obtain the error code that occurred.
getDescription()
Method used to obtain the description of the error that occurred.
73001
Context invalid
73002
Did not grant permission to open camera
73003
The lest API is 21(LOLLIPOP)
73004
Could not find implementation interface callback iAcessoBioSelfie
73005
Could not find implementation interface callback iAcessoBioDocument
73006
Unable to open camera on emulators
73100
Unable to connect to internet
73200
Please inform the json file name
73202
Unable to parse json file
73300
Unable to get unico authentication object
73301
Unable to parse object
73302
Could not find the unico token
73303
Current host is not registered
73400
Could not initialize camera
73500
Unable to get session token, service response error
73501
Unable to parce object
73502
Could not get session token
73701
Could not find active liveness import
73702
Unable to initialize active liveness in production mode
73703
Unable to get active liveness session
73704
The user pressed the cancel button and did not complete the Session.
73705
The Session was not performed successfully and a FaceScan was not generated. In general, other statuses will be sent to the
73706
The camera access is prevented because either the user has explicitly denied permission or the user's device is configured to
73707
The Session was cancelled due to the app being terminated, put to sleep, an OS notification, or the app was placed in the
73708
The Session was cancelled because device is in landscape mode. The user experience of devices in these orientations is poor
73709
The Session was cancelled because device is in reverse portrait mode. The user experience of devices in these orientations is
73710
The Session was cancelled because the user was unable to complete a Session in the default allotted time or the timeout set
73712
The Session was cancelled due to memory pressure.
73712
The Session was cancelled because your App is not in production and requires a network connection.
73713
The Session was cancelled because your key needs to be validated again.
73714
The Session was cancelled because the developer-configured encryption key was not valid.
73715
The Session was cancelled because not all guidance images were configured.
73716
The Session was cancelled because SDK was unable to start the camera on this device.
73717
The Session was cancelled because the user was in a locked out state.
73718
The Session was cancelled because of an unknown and unexpected error. SDK leverages a variety of iOS APIs including camera,
73719
The Session cancelled because user pressed the Get Ready screen subtext message. Note: This functionality is not available by
73800
Could not build encrypted key
DocumentCameraTypes.CPF
Capture the front of the CPF
DocumentCameraTypes.CNH
Capture the open CNH
DocumentCameraTypes.CNH_FRENTE
Capture the front of the CNH
DocumentCameraTypes.CNH_VERSO
Capture the back of the CNH
DocumentCameraTypes.RG_FRENTE
Capture the front of the RG
DocumentCameraTypes.RG_VERSO
Capture the back of the RG RG
DocumentCameraTypes.OUTROS("descrição")
Capture any other document
Have the Flutter Developer SDK installed.
ASUS - X01BDA
10.0.0
Físico
ASUS - Z01KD
8.0.1
Físico
HUAWEY - P30 Lite
9.0.0
Físico
LG - K22
10.0.0
Físico
LG - Q6
7.0.0
Físico
MOTOROLA - Moto one macro
10.0.0
Físico
MOTOROLA - Moto G4
6.0.1
Físico
MOTOROLA - Moto G5s Plus
8.1.0
Físico
MOTOROLA - Moto G6 Play
9.0.0
Físico
MOTOROLA - Moto G7 Play
10.0.0
Físico
MOTOROLA - Moto G7 Power
10.0.0
Físico
MOTOROLA - Moto G8 Power Lite
10.0.0
Físico
SAMSUNG - A01
10.0.0
Físico
SAMSUNG - J8 SM J810M
8.1.0
Físico
SAMSUNG - Galaxy A30s SM-A307GT
10.0.0
Físico
SAMSUNG - Galaxy A51
10.0.0
Físico
SAMSUNG - Galaxy A71
11.0.0
Físico
SAMSUNG - Galaxy S20+
11.0.0
Físico
SAMSUNG - s10e
11.0.0
Físico
XIAOMI - Mi 8 Lite
9.0.0
Físico
XIAOMI - Mi 8 Lite
10.0.0
Físico
XIAOMI - Poco X3
10.0.0
Físico
XIAOMI - Redmi Note 8
10.0.0
Físico
XIAOMI - Redmi Note 8 Pro
10.0.0
Físico
XIAOMI - Redmi Note 9
10.0.0
Físico
XIAOMI - Redmi Note 9 Pro
10.0.0
Físico
GOOGLE - Pixel sailfish
8.0.0
Virtual (TestLab)
HUAWEY - ALE L23
5.0.0
Virtual (TestLab)
HUAWEY - ANE LX1
9.0.0
Virtual (TestLab)
HUAWEY - ANE LX2
9.0.0
Virtual (TestLab)
HUAWEY - COR L29
8.1.0
Virtual (TestLab)
HUAWEY - MHA L29
7.0.0
Virtual (TestLab)
HUAWEY - NEO L29
9.0.0
Virtual (TestLab)
SAMSUNG - SC 02J
8.0.0
Virtual (TestLab)
SAMSUNG - SM G891A
9.0.0
Virtual (TestLab)
SAMSUNG - SM G930AZ
8.0.0
Virtual (TestLab)
SAMSUNG - SM G935A
8.0.0
Virtual (TestLab)
SAMSUNG - SM G965N
9.0.0
Virtual (TestLab)
SAMSUNG - SM G965U1
8.0.0
Virtual (TestLab)
SAMSUNG - SM G981U1
10.0.0
Virtual (TestLab)
SAMSUNG - SM J727V
8.1.0
Virtual (TestLab)
SAMSUNG - SM N950F
9.0.0
Virtual (TestLab)
SAMSUNG - SM N950N
9.0.0
Virtual (TestLab)
SAMSUNG - SM N950U
8.0.0
Virtual (TestLab)
SAMSUNG - SM N960F
9.0.0
Virtual (TestLab)
SAMSUNG - SM N960N
9.0.0
Virtual (TestLab)
SAMSUNG - SM N960U1
8.1.0
stLab)