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:

  • XCode 15.0.1 or higher;
  • iOS SDK version 11 higher;

If you are using swift in your project:

  • Swift CI Compiler > 5.4.2
  • Swift Syntax > 4.2

Configure and install the SDK

Install the SDK using CocoaPods or Swift Package Manager (SPM)

Using o CocoaPods

Installation

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. To detailed usage instructions, check the official documentation from cocoapods. To integrate the SDK in your XCode project using CocoaPods, follow the steps below:

Include the following line ´unicocheck-ios´ in your Podfile:

pod ‘unicocheck-ios’

Then, use the following command in your terminal to install the dependencies:

pod install --repo-update

Using o Swift Package Manager (SPM)

The Swift Package Manager is a tool for managing the distribution of Swift code. It's integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. To integrate the SDK in your project using SPM, you just need to include the dependency in your file Package.swift:

Package.swift
dependencies: [
.package(url: "https://github.com/acesso-io/unico-check-ios.git", .upToNextMajor(from: "2.12.0"))
]

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>
Be careful

If you are executing the project in .xcodeproj, it's necessary to open the project in .xcworkspace!

Configure your credentials

To use the SDK, you need to get valid credential keys. The following steps show you how to get these client keys and configure it in your project:

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 SDK section and add your SDK application name and Bundle ID;
  3. Save your changes.

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 Android option;
  5. Click on "Gerar" (Generate) and a new tab opens in your browser containing project information in JSON format.
Problems with pop-up blockers

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

  1. You can configure the JSON credentials in your app using one of the following options:

  2. Atualmente temos duas opções para associar as informações contidas no JSON ao projeto: Implementando o protocolo AcessoBioConfigDataSource ou Embarcando o arquivo JSON. Veja abaixo:

Option 1: Implementing the interface AcessoBioConfigDataSource

  1. Implement the interface AcessoBioConfigDataSource in your class;
  2. Copy the information from the JSON file, downloaded in in the step above, and paste it in the corresponding methods. Example:

JSON file with 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:


.h:
#import <AcessoBio/AcessoBioManager.h>
#import <AcessoBio/AcessoBio-Swift.h>

@interface YourUnicoConfigClass : AcessoBioConfigDataSource {}

@end

.m:
@implementation YourUnicoConfigClass

- (NSString * _Nonnull)getBundleIdentifier {
return @"<YOUR_MOBILE_BUNDLE_IDENTIFIER>"
}

- (NSString * _Nonnull)getHostInfo {
return @"<YOUR_HOST_INFO>"
}

- (NSString * _Nonnull)getHostKey {
return @"<YOUR_HOST_KEY>"
}

- (NSString * _Nonnull)getMobileSdkAppId {
return @"<YOUR_MOBILE_SDK_APP_ID>"
}

- (NSString * _Nonnull)getProjectId {
return @"<YOUR_PROJECT_ID>"
}

- (NSString * _Nonnull)getProjectNumber {
return @"<YOUR_PROJECT_NUMBER>"
}

@end

Option 2: Embed the JSON file

Add the JSON file, downloaded in the step above, inside your project's root directory.

Getting help

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

Next steps