Skip to main content

IOS SDK

important

The minimum version of IOS, supported by the SDK is 13.0.

caution

If Apple Review team asks for the privacy manifest file, that is missing in our SDK. Please update it to version 8.4.2 We have updated the lottie-ios library, that causes this issue and the privacy manifest file will be included.

caution

During the review process of your app, Apple might ask you to describe NFC usage in your app, even if you don't have NFC feature enabled. To successfully pass the verification, try to send them this video, which shows NFC usage in the KYC flow. If Apple still does not confirm, contact us for further communication.

iDenfy identity verification flow

note

Below you can check a full regular flow.

This flow can be customized and success results can be omitted as well. We recommend omitting them using our immediate redirect feature.

Full flow

Getting started

1. Obtaining verification token

The SDK requires a verification token for starting initialization. Look at verification token generation guide.

2. Providing permissions

NSCameraUsageDescription must be provided in the application's Info.plist file:

<key>NSCameraUsageDescription</key>
<string>Required for document and facial capture</string>

3. Adding the SDK dependency

note

We recommend using Swift Package Manager, since it is quicker to setup and causes less issues.

Swift Package Manager

1. Add a pacakge

You can add it to your project with the following package repositories. You need to choose only one SDK option.

Base iDenfySDK dependency:

iDenfySDK with Advanced Liveness detection feature:

iDenfySDK with Advanced Liveness detection and Document blur glare detection features:

iDenfySDK with Advanced Liveness detection, Document blur glare detection and NFC Reading features:

iDenfySDK with Advanced Liveness detection, Document blur glare detection, NFC Reading and Document Auto Capture features:

caution

We strongly recommend to choose an exact version of the latest SDK

2. Select the library

Choose either static or dynamic versions of the SDK and add the package

Embed & Sign
caution

If you are using dynamic framework, please make sure you have embedded & signed it to your application

Embed & Sign
note

To use the localized version of the liveness feature add FaceTec.strings to your app module. Otherwise, the localization will not work. Idenfy Assets are can be found in the following url Strings are located in ../IdenfyAssets/IdenfyStrings folder.

CocoaPods

1. Add dependency

Add the following line to your PodFile line with the latest version. The latest version is accessible from the changelog.

Base iDenfySDK dependency:

pod 'iDenfySDK', '8.6.0'

iDenfySDK with Advanced Liveness detection feature:

pod 'iDenfySDK/iDenfyLiveness', '8.6.0'

iDenfySDK with Advanced Liveness detection and Document blur glare detection features:

pod 'iDenfySDK/iDenfyBlurGlareDetection', '8.6.0'

iDenfySDK with Advanced Liveness detection, Document blur glare detection and NFC Reading features:

pod 'iDenfySDK/iDenfyNFCReading', '8.6.0'

iDenfySDK with Advanced Liveness detection, Document blur glare detection, NFC Reading and Document Auto Capture features:

pod 'iDenfySDK/iDenfyRecognition', '8.6.0'
note

If you are not overriding any custom views or applying customization, you can use the dynamic version. If you did make layout changes, don't use dynamic version, since runtime crashes can occur. If you understand the disadvantages and still want to use the latest version integrate the SDK in the following way:

pod 'iDenfySDK/iDenfyLiveness'
2. Update pods

Run pod install to install iDenfySDK or pod update to update the current iDenfySDK.

caution

After installing the SDK you may face some compile errors related to cocoapods. To solve them, please read the troubleshooting guide.

Manual

1. Download iDenfySDK

Download latest iDenfySDK build.

2. Include required modules

Copy all frameworks from the IdenfyLiveness folder into your app target folder.

note

To use the localized version of the liveness feature add FaceTec.strings to your app module. Otherwise, the localization will not work. Strings are located in ../iDenfySDK/IdenfyAssets/IdenfyStrings.

3. Embed & Sign

Embed & Sign included frameworks.

Embed & Sign
4. Include internal dependencies

iDenfySDK uses several internal dependencies. Your project should also include those dependencies using CocoaPods or in any other preferred way.

caution

If you face compile issues please read the troubleshooting guide.

4. Troubleshooting compile errors

If your application uses Objective-C bridging headers you might face the following compile error: using bridging headers with module interfaces is unsupported. Command CompileSwiftSources failed with a nonzero exit code.

Embed & Sign

To solve this error, you should try this step:

1. Change post_install script to the following:

post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "lottie-ios"
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
end

If your application has bitcode disabled and your build faces a compile error, due to enabled bitcode on any of our pods. You should try this step:

1. Change post_install script to the following:

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end

5. Configuring SDK

It is required to provide the following configuration:

let idenfySettingsV2 = IdenfyBuilderV2()
.withAuthToken("AUTH_TOKEN")
.build()

let idenfyController = IdenfyController.shared
idenfyController.initializeIdenfySDKV2WithManual(idenfySettingsV2: idenfySettingsV2)

6. Presenting ViewController

UIKit

An instance of IdenfyController is required for managing iDenfy ViewController. Following code will present initial ViewController:

let idenfyVC = idenfyController.instantiateNavigationController()
self.present(idenfyVC, animated: true, completion: nil)

SwiftUI

To initialize iDenfSDK in a SwiftUI project, you need to create an UIViewControllerRepresentable and present it in your view:

struct iDenfySDKUIViewController: UIViewControllerRepresentable {

let authToken: String

init(_ token: String) {
self.authToken = token
}

func makeUIViewController(context: Context) -> IdenfySDKNavigationController {
return initializeIdenfySDKDefault(authToken: authToken)
}

func updateUIViewController(_ viewController: IdenfySDKNavigationController, context: Context) {
//update Content
}

private func initializeIdenfySDKDefault(authToken: String) -> IdenfySDKNavigationController {
let idenfyUISettingsV2 = IdenfyUIBuilderV2()
.build()

let idenfySettingsV2 = IdenfyBuilderV2()
.withAuthToken(authToken)
.withUISettingsV2(idenfyUISettingsV2)
.build()

let idenfyController = IdenfyController.shared
idenfyController.initializeIdenfySDKV2WithManual(idenfySettingsV2: idenfySettingsV2)

handleSDKResults(idenfyController)
return idenfyController.instantiateNavigationController()
}
}
note

Full initialization code of iDenfySDK using SwiftUI is available in our sample application

7. Receiving callbacks from SDK

The SDK provides the following callback class idenfyIdentificationResult.

important

If your service uses only the automatic (default) callback, then you should only check the idenfyIdentificationResult.autoIdentificationStatus.

important

Since version 7.1.1, we have added a SUSPECTED response. You can read about it here and decide for yourself if you would like for it to impact your UI.

With getIdenfyResultWithDismiss method

     /// Returns user's verification result in the UIViewController dismiss completion webhook.
private func handleSDKResults(_ idenfyController: IdenfyController) {
idenfyController.getIdenfyResultWithDismiss(idenfyIdentificationResult: {
idenfyIdentificationResult
in
print("Auto: \(idenfyIdentificationResult.autoIdentificationStatus.rawValue), Manual: \(idenfyIdentificationResult.manualIdentificationStatus.rawValue)")
switch idenfyIdentificationResult.autoIdentificationStatus {
case .APPROVED:
// The user completed an identification flow and the identification status, provided by an automated platform, is APPROVED.
break
case .FAILED:
// The user completed an identification flow and the identification status, provided by an automated platform, is FAILED.
break
case .UNVERIFIED:
// The user did not complete an identification flow and the identification status, provided by an automated platform, is UNVERIFIED.
break
@unknown default:
break
}

switch idenfyIdentificationResult.manualIdentificationStatus {
case .APPROVED:
// The user completed an identification flow and was verified manually while waiting for the manual verification results in the iDenfy SDK. The identification status, provided by a manual review, is APPROVED.
break
case .FAILED:
// The user completed an identification flow and was verified manually while waiting for the manual verification results in the iDenfy SDK. The identification status, provided by a manual review, is FAILED.
break

case .WAITING:
// The user completed an identification flow and started waiting for the manual verification results in the iDenfy SDK. Then he/she decided to stop waiting and pressed a "BACK TO ACCOUNT" button. The manual identification review is still ongoing.
break

case .INACTIVE:
// The user was only verified by an automated platform, not by a manual reviewer. The identification performed by the user can still be verified by the manual review if your system uses the manual verification service.
break
@unknown default:
break
}

})
}

Information about the IdenfyIdentificationResult autoIdentificationStatus statuses:

NameDescription
APPROVEDThe user completed a verification flow and the verification status, provided by an automated platform, is APPROVED.
FAILEDThe user completed a verification flow and the verification status, provided by an automated platform, is FAILED.
UNVERIFIEDThe user did not complete a verification flow and the verification status, provided by an automated platform, is UNVERIFIED.

Information about the IdenfyIdentificationResult manualIdentificationStatus statuses:

NameDescription
APPROVEDThe user completed a verification flow and was verified manually while waiting for the manual verification results in the iDenfy SDK. The verification status, provided by a manual review, is APPROVED.
FAILEDThe user completed a verification flow and was verified manually while waiting for the manual verification results in the iDenfy SDK. The verification status, provided by a manual review, is FAILED.
WAITINGThe user completed a verification flow and started waiting for the manual verification results in the iDenfy SDK. Then he/she decided to stop waiting and pressed a "BACK TO ACCOUNT" button. The manual verification review is still ongoing.
INACTIVEThe user was only verified by an automated platform, not by a manual reviewer. The verification performed by the user can still be verified by the manual review if your system uses the manual verification service.
caution

The manualIdentificationStatus status always returns INACTIVE status, unless your system implemented manual verification flow (11 step). This is how our own manual verification screen looks like:

Manual verification screen

In order to disable it, refer to the immediate redirect feature.

note

These SDK statuses are the same as iFrame integration statuses. There is just a single difference that the SDK returns INACTIVE if the manual verification screen was not opened during the verification session instead of returning null, as iFrame does. Also, iFrame does not close automatically since it can deliver results without actually closing itself.

note

After SDK finishes and closes itself, you will also receive webhook callback to your backend system.

It might be useful to completely ignore the SDK status and communicate between your app and your backend service about verification status.

User events webhooks (optional)

SDK provides webhooks about events occurring throughout the verification process. Results will be delivered while the verification process is occurring and the application is presenting views of the SDK.

1. Declare a class for receiving events

Declare a class that implements IdenfyUserFlowHandler to call your backend service, log events, or apply changes.

import iDenfySDK

@objc public class IdenfyUserFlowCallbacksHandler: NSObject, IdenfyUserFlowHandler {
public func onPhotoUploaded(photo: String, step: String) {
print("IdenfyUserFlowHandler - onPhotoUploaded \(step)")
}

public func onDocumentSelected(documentType: String) {
print("IdenfyUserFlowHandler - onDocumentSelected \(documentType)")
}

public func onCountrySelected(issuingCountryCode: String) {
print("IdenfyUserFlowHandler - onCountrySelected \(issuingCountryCode)")
}

public func onProcessingStarted(processingStarted: Bool) {
print("IdenfyUserFlowHandler - onProcessingStarted \(processingStarted)")
}
}

2. Set the idenfyUserFlowCallbacksHandler

Set the idenfyUserFlowCallbacksHandler in the IdenfyController class:

...
idenfyController.setIdenfyUserFlowCallbacksHandler(idenfyUserFlowHandler: IdenfyUserFlowCallbacksHandler())
...

Customizing SDK flow (optional)

The SDK provides various options for modifying verification flow.

SSL pinning support

By default, the SDK does not utilize SSL pinning as suggested by the AWS services. If you however need this option, you can enable SSL pinning. Our SSL pinning implementation does follow the AWS recommendations and we utilize pinning for the Root certificates. They are valid for more than 5+ years.

However, during this timeframe, major changes can occur and we might be forced to change SSL pinning. Such changes will be notified at least 1 month prior.

This is why we strongly encourage you to enable this feature only if you are planning to actively update the SDK.

Swift
    let idenfySettingsV2 = IdenfyBuilderV2()
.withAuthToken(authToken)
.withSSLPinning(true)
...
.build()
...

NFC support

The SDK provides NFC enhanced identity verification.

For more integration details and potential advantages contact tech support via our dashboard.

After NFC is enabled for your client settings, follow these integration details:

1. Adding the NFC Reading dependency

Add the following line to your PodFile line with the latest version. The latest version is accessible from the changelog.

pod 'iDenfySDK/iDenfyNFCReading', '8.6.0'

2. Add Near Field Communication Tag Reading capability:

Add the Near Field Communication Tag Reading capability to your app target.

NFC capability

3. Update Info.plist file:

Add the following lines to the Info.plist file:

<dict>
...
<key>NFCReaderUsageDescription</key>
<string>This app uses NFC to scan passports</string>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002471001</string>
<string>A0000002472001</string>
<string>00000000000000</string>
</array>
</dict>

NFC required

If the NFC required feature is enabled, the device which does not possess the verification will immediately fail verification. This is a security feature, which ensures that a person does not change a device just to perform verification.

To enable verifications for all devices, your app can easily handle this scenario. You will need to follow the following steps:

  1. Create two different accounts: with NFC enabled and without.
  2. Check if the device supports NFC, before generating a verification token.
  3. If the device supports the NFC, you generate a verification token with the account's credentials, which has the NFC feature enabled. If NFC is not enabled, you should use another account's credentials.

NFC optional

If the NFC optional feature is enabled, the user is asked to perform documet NFC reading ONLY if the device and selected document type support NFC chip reading. Otherwise, a regular identifiy verification will be performed.

Localization

By default SDK provides the following translations:

  • English (en) GB
  • Polish (pl) PL
  • Russian (ru) RU
  • Lithuanian (lt) LT
  • German (de) DE
  • French (fr) FR
  • Italian (it) IT
  • Latvian (lv) LV
  • Romanian (ro) RO
  • Swedish (sv) SV
  • Spanish (es) ES
  • Estonian (et) ET
  • Czech (cs) CS
  • Bulgarian (bg) BG
  • Dutch (nl) NL
  • Ukrainian (uk) UK
  • Portuguese (pt) PT
  • Vietnamese (vi) VI
  • Slovak (sk) SK
  • Indonesian (id) ID
  • Thai (th) TH
  • Hindi (hi) HI
  • Hungarian (hu) HU
  • Danish (da) DA
  • Greek (el) EL
  • Croatian (hr) HR
  • Norwegian (no) NO
  • Serbian (sr) SR
  • Finnish (fi) FI
  • Turkish (tr) TR
  • Chinese (zh) ZH

All keys are located in here. You can supply partial translations, meaning if you don't include a translation to a particular key, then our SDK will use default keys. To see changes add Idenfy.strings to your app target and changes will take effect.

Forcing specific language

The default language of SDK is selected by the language configurations of the device. In order to force particular locale, several methods can be used:

IdenfySettings
    IdenfyBuilderV2()
.withSelectedLocale(IdenfyLocaleEnum.EN)
...
Along with the token generation
note

If no locale is forced, the SDK will fallback to device's selected language

Getting the SDK version

Sometimes, it might be useful to get the current SDK version to add additional logging for your application. You can get the SDK version by calling the following method in the IdenfyController:

    let sdkVersion = idenfyController.getIdenfySDKVersion()
print("version:\(sdkVersion)")
...

Skipping parts of verification flow

The SDK provides a set of tools to omit some views, which could be created in your application yourself offering a fine-grained approach. For example, you would like to implement document selection and the document's issuing country selection in the same view instead of having 2 separate.

note

All customization options listed below can be combined, e.g. you can skip both document selection, confirmation screen, and document issuing country selection.

note

Contact tech support via our dashboard for enabling any of these features to your account settings, since these settings are configured from the backend, not the SDK.

* Skip document's issuing country selection screen.

1. Generate a verification token with the provided document issuing country.

Take a look at verification token generation documentation.

Example of a JSON request body:

{
"clientId": "TEST_CLIENT_ID",
"country": "lt"
}

* Skip documents selection screen.

1. Generate a verification token with the provided document type.

Take a look at verification token generation documentation.

Example of a JSON request body:

{
"clientId": "TEST_CLIENT_ID",
"documents": ["PASSPORT"]
}

* Skip document onboarding screen.

After this feature is enabled, the onboarding screen will be skipped, e.g. user can select a document from the documents list and will be immediately redirected to the camera screen.

Blur and glare flow changes

If your account has enabled blur or glare detection, the SDK will include blur and glare checks to the photo validation, an unsuccessful result will be shown immediately after each step.

note

For enabling blur and glare detection contact tech support via our dashboard

Passive liveness check

If your account has enabled passive liveness check, the SDK will include liveness check to photo validation, an unsuccessful result will be shown immediately after each step.

note

For enabling passive liveness check contact tech support via our dashboard

Identity verification results screen changes

If you have implemented manual verification flow (11 step) it might be wise to disable Manual results view, DENIED and APPROVED views for better UI/UX.

Since you most likely will display a loading screen or indicate the user about ongoing manual verification check after he completes the verification flow.

This is why SDK finishes during the loading screen, without showing actual status and empowers you to customize it in your preferred way.

To disable those views, the immediate redirect feature can be applied. After enabling immediate redirect the following results will take place:

APPROVED screen will not be visible

If verification was approved, the user will not see a successful screen. SDK will be closed while displaying a loading screen. That way you can show a success screen yourself at a particular time.

DENIED screen will not be visible

The denied screen will not be visible. SDK will be closed while displaying a loading screen. That way you can display an error screen yourself at a particular time.

Manual verification screen will not be visible.

The manual verification screen is visible here.

note

For enabling immediate redirect contact tech support via our dashboard

Custom KYC Questionnaire

This features allows you to create a custom questionnaire users must fill in at the beginning of every identity verification process. The questionnaire can contain required or optional questions and variety of question types.

note

For enabling custom KYC questionnaire feature, contact techsupport@idenfy.com

Custom KYC Questionnaire conditions

Questionnaire can be created using conditions, according to answers of previous questions:

Custom Privacy Policy

This features allows you to create a custom privacy policy users must agree to at the beginning of every identity verification process. The privacy policy is presented as an HTML and can be fully customised.

note

For enabling custom privacy policy feature, contact techsupport@idenfy.com

UI customization

Please take a look at the UI customization page.

Samples

SDK Integration tutorials

Our UIKit sample or SwiftUI sample applications demonstrate the integration of iDenfy SDK. For more information visit SDK integration tutorials.

Additional features

Realtime document blur glare detection

This feature provides real-time document blur glare detection. Users will be informed by a warning alert when blur or glare is detected in the camera feed. As well as additional warning in the photo result view.

:

1. Adding the document blur glare detection dependency

Add the following line to your PodFile line with the latest version. The latest version is accessible from the changelog.

pod 'iDenfySDK/iDenfyBlurGlareDetection', '8.6.0'
note

iDenfySDK/iDenfyBlurGlareDetection module also includes Liveness detection

note

Contact our tech support at techsupport@idenfy.com for enabling this feature

Document Recognition

This feature provides real-time document recognition. Documents, shown in FRONT and BACK steps, will be automatically detected and captured. It allows us to take a better picture of the document.

To seek a better result, documents, that are not fully visible or do not match selected country and document type, will NOT be recognized and captured. As a result, the final verification status will be more accurate.

If a document cannot be recognized in a certain period of time (10 seconds), SDK will fallback to regular photo capturing.

caution

This feature is still in an early stage. Therefore, minors bugs might occur.

1. Adding the document recognition dependency

Add the following line to your PodFile line with the latest version. The latest version is accessible from the changelog.

pod 'iDenfySDK/iDenfyRecognition', '8.6.0'
note

iDenfySDK/iDenfyRecognition module also includes Liveness detection

note

For enabling Document Recognition feature, please contact techsupport@idenfy.com

Face detection

While taking a regular face photo, face detection feature can be enabled, which requires users to place their face into the marked area before taking a photo.

For better success rate, faces, that are far away from the camera won't be able to pass as well.

Face detection
note

Contact our tech support at techsupport@idenfy.com for enabling this feature. Note that face detection will apply to both KYC verification and face authentication flows.

Face auto capture

While taking a regular face photo, face auto capture feature can be enabled, which requires users only to place their face into the marked area and face photo will be automatically captured.

For better success rate, faces, that are too close or far away from the camera won't be able to pass as well.

Face auto capture
note

Contact our tech support at techsupport@idenfy.com for enabling this feature

Advanced Liveness detection

SDK provides an advanced liveness recognition feature.

caution

The new major liveness version is released every 6-12 months. Your app must update the liveness module after every major release. If SDK is not updated, it can lead to the runtime crashes.

If you already have installed 'iDenfySDK/iDenfyLiveness', you only need to configure localization:

To use a localized version of the liveness feature, add the FaceTec.strings to your app module.

Strings are located in ../Pods/iDenfySDK/iDenfySDK/IdenfyAssets/IdenfyStrings folder or in the following url

note

Contact tech support via our dashboard for enabling the liveness feature.

FAQ

1. Is there a possibility to change verification results view?

2. How to change the position of the top titles?

3. How do I report an issue within the SDK?

  • Please report any issue at techsupport@idenfy.com. Please attach versions of SDK, Xcode you are using, describe the problem as much detailed as possible.

4. When I override liveness fonts, the size does not change. Why is that?

  • Liveness font size is dynamically determined according to the screen resolution, and it cannot be manually changed.

5. What if Apple Review team denies our application because of iDenfy SDK?

  • If any problems occur with the Apple Review team, please check out our privacy policy to find possible answers to the arisen questions.
  • If Apple Review team asks for a demo of our NFC functionality, please provide the following video.

Additional SDK information

SDK size impact on applications

  • iDenfySDK module increases ~20 MB of a compressed ipa file size
  • iDenfySDK/iDenfyLiveness module increases ~25 MB of a compressed ipa file size
  • iDenfySDK/iDenfyBlurGlareDetection module increases ~105 MB of a compressed ipa file size
  • iDenfySDK/iDenfyNFCReading module increases ~106 MB of a compressed ipa file size
  • iDenfySDK/iDenfyRecognition module increases ~114 MB of a compressed ipa file size

SDK and not platform-specific choices

Here will be listed all unique choices, which are not that present in other SDK/platforms in general.

Internet disconnect

Since it is one of the requirements to have a KYC session uninterruptible, we changed the user's flow. Read the information below.

important

If the network disappears for more than 5 seconds when the user is still in the camera windows, a user is returned to the KYC initial screen.

Full flow
important

If the network disappears for more than 5 seconds when the user is in any other window, a user's actions and clicks are blocked, until connection appears.

Full flow

I hope it makes sense :) Requirements are challenging to follow, but iDenfy is doing its best!