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
:
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>
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
To use the iOS SDK you need to obtain the SDK Key credential, a unique customer identification key generated by the Unico team.
- 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.
Credentials (Client API Key) - Deprecated Method
To import the credentials (Client API Key) into your project, use the following guide:
- 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 SDK section and add your SDK application name and Bundle ID;
- Save your changes.
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 Android option;
- Click on "Gerar" (Generate) and a new tab opens in your browser containing project information in JSON format.
You may need to temporarily disable your pop-up blocker to see the download window.
Implementing the interface AcessoBioConfigDataSource
To add the SDK Key to the project, implement the AccessBioConfigDataSource protocol in your class.
- Objective-c
- Swift
.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)getHostKey {
return @"<YOUR_SDK_KEY>";
}
@end
import AcessoBio
class YourUnicoConfigClass: AcessoBioConfigDataSource {
func getBundleIdentifier() -> String {
return "<YOUR_MOBILE_BUNDLE_IDENTIFIER>"
}
func getHostKey() -> String {
return "<YOUR_SDK_KEY>"
}
}
Credentials (Client API Key) - Deprecated Method
- Objective-c
- Swift
.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
import AcessoBio
class YourUnicoConfigClass : AcessoBioConfigDataSource {
func getProjectNumber() -> String {
return "<YOUR_PROJECT_NUMBER>"
}
func getProjectId() -> String {
return "<YOUR_PROJECT_ID>"
}
func getMobileSdkAppId() -> String {
return "<YOUR_MOBILE_SDK_APP_ID>"
}
func getBundleIdentifier() -> String {
return "<YOUR_MOBILE_BUNDLE_IDENTIFIER>"
}
func getHostInfo() -> String {
return "<YOUR_HOST_INFO>"
}
func getHostKey() -> String {
return "<YOUR_HOST_KEYO>"
}
}
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.