Bioidentity Integration in IOS
Trust BioIdentity
TrustBioidentity is an SDK responsible for providing identity validation through a photograph of a person's fingerprint using the camera of a mobile device
Table of contents
Implementation
Easiest way to install TrustBioidentity is by using Cocoapods within just a few steps:
- Initialize cocoapods in your project (if it's not already done):
pod init
this would generate a Podfile and Pods folder.
- Complete Podfile according to your needs:
platform :ios, '13.0'
# this indicates the source where Cocoapods would find the pod to install
source 'https://gitlab.com/trustchile/movil-libs/lat_trust_mobile_ios_bioidentity_library_podspec'
target 'AppName': do
use_frameworks!
...
# pod name and version to install
pod 'TrustBioIdentity', '~> 2.2.0'
...
end
- Finally install previously specified dependencies using:
pod install
Initialize
Builder
Name | Description | Default Value | Optional |
---|---|---|---|
nin | DNI of the user | - | No |
country | Specifies the country | CHL | No |
index | - | - | - |
strategyType | Specifies the finger | FINGER | No |
companyId | Specifies the id of the company | - | No |
provider | Specifies the provider company | TRUST | No |
clientId | Specifies the client Id | - | No |
clientSecret | Specifies the client secret | - | No |
transactionId | Specifies the transaction Id | null | Yes |
Example Builder
var bioIdentity = TrustBioIdentity.builder
.nin("123456789")
.companyId(1)
.index(2)
.clientId(<YOUR_CLIENT_ID>)
.clientSecret(<YOUR_CLIENT_SECRET>)
.provider(Provider.trust)
.country(Country.chile)
.strategyType(Strategy.finger)
.transactionId("12345")
.build()
Usage
TrustBioIdentity methods
Request validation
This methods allows client application to ask its user for a fingerprint validation by making a picture of its finger.
bioIdentity.requestValidation()
Request enroll
This methods allows client application to ask its user for a fingerprint enrollment by making a picture of its finger.
bioIdentity.requestEnroll()
Errors
TrustError definition:
- code: Code of error check specification
- localizedDescription: Error description as String
Codes
Possible errors that can be found when integrating the SDK
Code | Value |
---|---|
0 | Unknown error |
400 | Bad request |
401 | The request was unauthorized |
403 | The request was forbidden |
404 | The requested could not be found |
405 | Method not allowed |
500 | Internal server error |
501 | Not implemented |
502 | Bad gateway |
503 | Service unavailable |
2000 | Error code bioidentity response |
2003 | Unsupported code bioidentity response |
9000 | Server error |