### Configure CocoaPods post_install for Lottie compatibility
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
Adjusts build settings for lottie-ios to enable library distribution, resolving bridging header compile errors.
```ruby
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
```
--------------------------------
### Initialize and Present iDenfy Verification Activity
Source: https://documentation.idenfy.com/mobile/Android/android-sdk
Obtain an instance of `IdenfyController` and use it to initialize the SDK with your settings and a callback for handling identification results. This action presents the verification activity to the user.
```kotlin
IdenfyController.getInstance().initializeIdenfySDKV2WithManual(
this,
identificationResultsCallback,
idenfySettingsV2
)
```
--------------------------------
### Initialize iDenfy SDK
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
Initializes the iDenfy SDK using the IdenfyBuilderV2 pattern to set authentication tokens and settings.
```swift
let idenfySettingsV2 = IdenfyBuilderV2()
.withAuthToken("AUTH_TOKEN")
.build()
let idenfyController = IdenfyController.shared
idenfyController.initializeIdenfySDKV2WithManual(idenfySettingsV2: idenfySettingsV2)
```
```objective-c
IdenfyBuilderV2 *idenfyBuilderV2 = [[IdenfyBuilderV2 alloc] init];
idenfyBuilderV2 = [idenfyBuilderV2 withAuthToken:authToken];
IdenfySettingsV2 *idenfySettingsV2 = [idenfyBuilderV2 build];
IdenfyController *idenfyController = [IdenfyController shared];
[idenfyController initializeIdenfySDKV2WithManualWithIdenfySettingsV2:idenfySettingsV2];
```
--------------------------------
### Configure iDenfy SDK with Auth Token
Source: https://documentation.idenfy.com/mobile/Android/android-sdk
Initialize the `IdenfySettingsV2` object by providing your authentication token. This token is essential for authenticating your requests to the iDenfy service and initiating the verification process.
```kotlin
val idenfySettingsV2 = IdenfySettingsV2.IdenfyBuilderV2()
.withAuthToken("AUTH_TOKEN")
.build()
```
--------------------------------
### Start/Stop AML Monitoring Response Example (200 OK)
Source: https://documentation.idenfy.com/aml/amlV3/amlMonitoringV3/amlMonitroingManagingV3
Example of a successful response (200 OK) when starting or stopping an AML monitoring process. It includes details about the monitoring, its status, expiration, and associated AML check information.
```JSON
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"isSubscribed": true,
"status": "ACTIVE",
"expiration": "2019-08-24T14:15:22Z",
"created": "2019-08-24T14:15:22Z",
"amlCheck": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"clientId": "string",
"checkedAt": "2019-08-24T14:15:22Z",
"created": "2019-08-24T14:15:22Z",
"userType": "COMPANY",
"services": [
"AML_CHECK"
],
"input": {
"fullName": "string",
"nationality": "AF",
"dateOfBirth": "2019-08-24",
"sex": "MALE"
},
"filter": {
"threshold": 85,
"datasets": [
"PEP_CURRENT"
],
"sanctionBodies": [
1
],
"dateOfBirthMatching": "EXACT",
"pepTiers": [
"PEP_TIER_1"
]
},
"amlCheck": [
{
"version": 0,
"resourceId": "string",
"score": 0,
"match": "string",
"name": "string",
"addresses": [
{
"geography": "string",
"city": "string"
}
],
"nationalities": [
"AF"
],
"datesOfBirth": [
"string"
],
"gender": "MALE",
"profileImage": "string",
"datasets": [
"PEP_CURRENT"
],
"currentSanBodyIds": [
0
],
"formerSanBodyIds": [
0
],
"pepTier": "PEP_TIER_1"
}
],
"adverseMedia": [
{
"title": "string",
"url": "http://example.com",
"text": "string",
"score": 0,
"type": "NEGATIVE",
"publishDate": "2019-08-24"
}
],
"overallStatus": "NOT_CHECKED"
},
"tags": [ ]
}
```
--------------------------------
### Start HTTP Listener Server (C#)
Source: https://documentation.idenfy.com/security/CallbackSigning
The main entry point for the application. It defines a URL prefix and starts the HTTP listener server to begin accepting incoming requests.
```csharp
public static void Main(string[] args)
{
string urlPrefix = "http://*:8080/";
StartServer(urlPrefix);
}
```
--------------------------------
### Present iDenfy ViewController in UIKit
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
Instantiates the navigation controller from the iDenfy controller and presents it modally.
```swift
let idenfyVC = idenfyController.instantiateNavigationController()
self.present(idenfyVC, animated: true, completion: nil)
```
```objective-c
UINavigationController *idenfyVC = [idenfyController instantiateNavigationController];
[self presentViewController:idenfyVC animated:YES completion:nil];
```
--------------------------------
### Refactor FaceCameraViewV2 setupUIViewFaceOval in Swift
Source: https://documentation.idenfy.com/mobile/iOS/migration-guide/ios-migrations
Shows the refactored setupUIViewFaceOval function in FaceCameraViewV2 using a helper function to get the drawer height. This change is part of the removal of the instructions drawer option. It ensures proper margin and constraint setup for the face oval view.
```swift
func setupUIViewFaceOval() {
addSubview(idenfyUIViewFaceOval)
idenfyUIViewFaceOval.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
idenfyUIViewFaceOval.bottomAnchor.constraint(equalTo: cameraSessionsButtons.idenfyUIViewContainerOfButtons.topAnchor, constant: -16).isActive = true
var top = CameraSessionUIHelper.getDrawerHeight()
// adding more for better margin
top += 16
idenfyUIViewFaceOval.topAnchor.constraint(equalTo: topAnchor, constant: top).isActive = true
idenfyUIViewFaceOval.widthAnchor.constraint(equalTo: idenfyUIViewFaceOval.heightAnchor, multiplier: 0.7).isActive = true
}
```
--------------------------------
### Start/Stop AML Monitoring Request Body Example
Source: https://documentation.idenfy.com/aml/amlV3/amlMonitoringV3/amlMonitroingManagingV3
Example of the JSON request body used for starting or stopping an AML monitoring process. It includes a 'comment' field for providing additional context.
```JSON
{
"comment": "string"
}
```
--------------------------------
### Response Example for Identification Token Creation
Source: https://documentation.idenfy.com/API/AdditionalSteps
This is an example of a successful response after creating an identification token. It includes details about the token, scan references, and configuration for additional steps, such as proof of address requirements.
```json
{
"message": "Token created successfully",
"authToken": "57K5hu3HSTOLCg4UFNpdwZqsC8tDG0PLnvgcY4sC",
"scanRef": "10bb0ade-4784-11ec-a167-02476f3f1509",
"clientId": "123",
"personScanRef": "123",
"firstName": null,
"lastName": null,
"successUrl": null,
"errorUrl": null,
"unverifiedUrl": null,
"callbackUrl": null,
"locale": "en",
"country": null,
"expiryTime": 3600,
"sessionLength": 600,
"documents": ["ID_CARD", "PASSPORT", "DRIVER_LICENSE", "RESIDENCE_PERMIT"],
"dateOfBirth": null,
"dateOfExpiry": null,
"dateOfIssue": null,
"nationality": null,
"personalNumber": null,
"documentNumber": null,
"sex": null,
"address": null,
"showInstructions": true,
"tokenType": "IDENTIFICATION",
"utilityBill": null,
"additionalSteps": {
"ALL": {
"ALL": {
"UTILITY_BILL": {
"type": "EXTRACT",
"texts": {
"de": {
"name": "Bitte laden Sie einen Adressnachweis hoch",
"description": "Bitte achten Sie darauf, dass der Adressnachweis vollständig sichtbar und nicht älter als 3 Monate ist. Alle Informationen müssen deutlich sichtbar sein, einschließlich Ihres vollständigen Namens, Ihrer Adresse und des Datums des Dokuments, und das Dokument muss eine gültige Stromrechnung sein, ein Kontoauszug, da handschriftliche Papiere nicht akzeptiert werden. Außerdem muss die Stromrechnung im lateinischen Alphabet sein. Ausweisdokumente werden nicht als gültiger Adressnachweis akzeptiert."
},
"en": {
"name": "Please upload a proof of address document",
"description": "Please make sure that the proof of address document is fully visible and is not older than 3 months. All information must be clearly visible including your full name, address, date of the document, and the document must be a legitimate utility bill or a bank statement, as handwritten papers are not accepted. Also, the utility bill must be in Latin alphabet. ID documents are not accepted as valid proof of address."
}
},
"fields": ["address"],
"settings": {
"canUpload": true,
"canCapture": false,
"canUploadPDF": true
}
}
}
}
},
"additionalData": {
"UTILITY_BILL": {
"address": "1234, Drive/Street, City/State, postcode, etc."
}
},
"externalRef": null,
"digitString": null
}
```
--------------------------------
### Update Custom Onboarding Layouts (XML)
Source: https://documentation.idenfy.com/mobile/Android/migration-guide/android-migrations
This snippet shows an example of an updated Android XML layout for the onboarding view. It highlights the removal of specific views like 'idenfy_cardview_instructions_description' and the change in how instructions are handled. Developers should adapt their custom layouts accordingly.
```xml
```
--------------------------------
### Configure Java 11 for Android Studio
Source: https://documentation.idenfy.com/mobile/Android/android-sdk
Ensure your Android Studio project is configured to use Java 11 for both source and target compatibility. This is a requirement for the iDenfy SDK. Update your app-level `build.gradle` and `gradle.properties` files accordingly.
```gradle
compileOptions {
targetCompatibility 11
sourceCompatibility 11
}
kotlinOptions {
jvmTarget = "11"
}
```
```properties
android.useAndroidX=true
android.enableJetifier=true
```
--------------------------------
### Integrate Dynamic Framework with CocoaPods (Podfile)
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
This is an alternative way to integrate the iDenfySDK using CocoaPods, specifically for dynamic frameworks. Use this if you are not overriding custom views or applying significant customizations.
```ruby
pod 'iDenfySDK/iDenfyLiveness'
```
--------------------------------
### List Ordered Documents Response Example (JSON)
Source: https://documentation.idenfy.com/KYB/kybReports/kybRegistryReports
This JSON object represents an example response when listing ordered documents. It includes details such as document ID, title, format, product key, delivery times, price, status, and a file URL.
```json
[
{
"id": "39e40532-8838-402b-a72e-ab39d1c43b16",
"title": "Company Officials",
"documentFormat": "PDF",
"productKey": "EBRON_RUJSX0NvbXBhbnlPZmZpY2lhbHNfMQ==_MzA0NjE3NjIx__",
"expectedDeliveryTime": "2024-01-02T09:51:53.643567Z",
"price": 1.0,
"deliveredAt": "2024-01-02T09:52:55.543725Z",
"status": "FINISHED",
"file": "https://s3.eu-west-1.amazonaws.com/production.users.storage/kyb_storage/partners/2253/ordered_documents/40326ba2-84b5-41b4-810b-3b765a335d24.pdf?AWSAccessKeyId=AKIAJEE33B4FZLU73WMA&Signature=n5fjCoNfcoWKssaypTASA3L%2BJw%3D&Expires=1704192777"
},
{
"id": "f0733089-c27e-47cb-b49d-e9950097aed2",
"title": "Beneficial Ownership Report",
"documentFormat": "PDF",
"productKey": "ROWOFF_Q1pfVUJP_QmVuZWZpY2lhbCBPd25lcnNoaXAgUmVwb3J0_MjYxODU2MTA=___MS8xLzAwMDEgMTI6MDA6MDAgQU0=__S1lDT04=",
"expectedDeliveryTime": "2023-12-14T08:24:18.959072Z",
"price": 5.0,
"deliveredAt": "2023-12-14T09:21:58.768875Z",
"status": "FINISHED",
"file": "https://s3.eu-west-1.amazonaws.com/production.users.storage/kyb_storage/partners/2253/ordered_documents/9f97ec5a-df0e-4dd6-834f-9c26982a9b6c.pdf?AWSAccessKeyId=AKIAJEE33B4FZLU73WMA&Signature=np2%2B8JyWK2n0SWIjbnEbUGVm9H%3D&Expires=1704192777"
}
]
```
--------------------------------
### Configure Camera Usage Description in Info.plist (XML)
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
This snippet shows how to add the `NSCameraUsageDescription` key to your application's Info.plist file. This is a required permission for the SDK to perform document and facial capture.
```xml
NSCameraUsageDescription
Required for document and facial capture
```
--------------------------------
### Setup UI Container for Buttons in Swift
Source: https://documentation.idenfy.com/mobile/iOS/migration-guide/ios-migrations
This Swift function sets up a UI container for buttons, adjusting its height based on a multiplier constant. This change impacts picture cropping by ensuring consistent button container height relative to the screen.
```swift
/**
idenfyCameraBottomControlsHeightMultiplier is used in photo cropping,
make sure you change the height of idenfyUIViewContainerOfButtons by changing the idenfyCameraBottomControlsHeightMultiplier constant
*/
open func setupUIViewContainerOfButtons() {
addSubview(idenfyUIViewContainerOfButtons)
idenfyUIViewContainerOfButtons.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
idenfyUIViewContainerOfButtons.trailingAnchor.constraint(equalTo: trailingAnchor).isActive = true
idenfyUIViewContainerOfButtons.heightAnchor.constraint(equalTo: heightAnchor, multiplier: ConstsIdenfyUI.idenfyCameraBottomControlsHeightMultiplier).isActive = true
idenfyUIViewContainerOfButtons.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true
}
```
--------------------------------
### Credit Bureau Document Response Example
Source: https://documentation.idenfy.com/KYB/kybReports/kybCreditBureau
This is an example response when retrieving a specific or all Credit Bureau documents. It provides the document's 'id', 'externalCompanyId', 'checkedAt' timestamp, 'status', and the format of the 'dataFile' and 'reportFile'.
```JSON
[
{
"id": "string",
"externalCompanyId": "string",
"checkedAt": "2022-06-30T10:15:47.692Z",
"status": "ACTIVE",
"dataFile": "JSON",
"reportFile": "PDF"
}
]
```
--------------------------------
### Configure Full SDK Logging in Kotlin
Source: https://documentation.idenfy.com/mobile/Android/android-logging-webhooks
Shows how to initialize the iDenfy SDK with full logging enabled, including OkHttp request and response payloads in Logcat.
```Kotlin
val idenfySettingsV2 = IdenfySettingsV2.IdenfyBuilderV2()
.withAuthToken(authToken)
.withLogging(IdenfySDKLoggingEnum.FULL)
.build()
```
--------------------------------
### Configure iDenfy SDK V2 with Auth Token (Swift)
Source: https://documentation.idenfy.com/mobile/iOS/ios-sdk
This Swift code snippet demonstrates how to configure the iDenfy SDK V2 by providing an authentication token. It uses the IdenfyBuilderV2 to build the settings and then initializes the SDK via the IdenfyController.
```swift
let idenfySettingsV2 = IdenfyBuilderV2()
.withAuthToken("AUTH_TOKEN")
.build()
let idenfyController = IdenfyController.shared
idenfyController.initializeIdenfySDKV2WithManual(idenfySettingsV2: idenfySettingsV2)
```
--------------------------------
### Integrate iDenfy SDK with SwiftUI
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
Wraps the iDenfy SDK within a UIViewControllerRepresentable to allow usage in SwiftUI views.
```swift
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) {
}
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()
}
}
```
--------------------------------
### Add Beneficiary Document Response Sample
Source: https://documentation.idenfy.com/KYB/KYBIntegration/kybCollectInformation
Example JSON response after successfully adding a beneficiary document, including its ID, type, filename, and a URL to the uploaded file.
```JSON
{
"id": "string",
"type": "IDENTITY_DOCUMENT",
"filename": "string",
"file": "http://example.com"
}
```
--------------------------------
### Configure CocoaPods post_install to disable Bitcode
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
Forces all pods to disable bitcode, useful when the main application has bitcode disabled to prevent compile errors.
```ruby
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
```
--------------------------------
### Configure Camera OnBoarding View
Source: https://documentation.idenfy.com/mobile/Android/android-ui-customization
This code configures the camera onboarding view, which serves as an introductory screen for users. It allows specifying the type of onboarding view to be displayed before each verification step.
```kotlin
IdenfyUISettingsV2.IdenfyUIBuilderV2()
/**
* OnBoarding View acts as additional screen, which helps user to familiarize himself with current step
* @param idenfyOnBoardingViewTypeEnum Defines onBoarding view type
*/
.withConfirmationView(idenfyOnBoardingViewTypeEnum: IdenfyOnBoardingViewTypeEnum)
...
build()
```
--------------------------------
### Add Base iDenfySDK via CocoaPods (Podfile)
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
This line should be added to your Podfile to include the base iDenfySDK using CocoaPods. Ensure you use the latest version available from the changelog.
```ruby
pod 'iDenfySDK', '8.8.0'
```
--------------------------------
### Present iDenfy ViewController using UIKit (Swift)
Source: https://documentation.idenfy.com/mobile/iOS/ios-sdk
This Swift code demonstrates how to present the iDenfy SDK's ViewController within a UIKit application. It obtains an instance of IdenfyController and uses it to instantiate the navigation controller, which is then presented modally.
```swift
let idenfyVC = idenfyController.instantiateNavigationController()
self.present(idenfyVC, animated: true, completion: nil)
```
--------------------------------
### POST /session/create (Sample Flows)
Source: https://documentation.idenfy.com/extra/DocumentResources
Endpoints for initiating verification sessions using sample data to trigger specific verification outcomes.
```APIDOC
## POST /session/create
### Description
Initiates a verification session using sample user data to test specific verification outcomes like approval, rejection, or AML suspicion.
### Method
POST
### Endpoint
/session/create
### Request Body
- **clientId** (string) - Required - The unique identifier for the client.
- **firstName** (string) - Required - The first name of the sample user.
- **lastName** (string) - Required - The last name of the sample user.
### Request Example
{
"clientId": "00000000",
"firstName": "John",
"lastName": "Sample Butch"
}
### Response
#### Success Response (200)
- **overall** (string) - The final verification status (APPROVED, DENIED, or SUSPECTED).
- **suspicionReasons** (array) - List of reasons for suspicion.
- **mismatchTags** (array) - Tags identifying data mismatches.
- **fraudTags** (array) - Tags identifying potential fraud.
- **autoDocument** (string) - Status of the document validation.
- **autoFace** (string) - Status of the face matching.
#### Response Example
{
"overall": "APPROVED",
"suspicionReasons": [],
"mismatchTags": [],
"fraudTags": [],
"autoDocument": "DOC_VALIDATED",
"autoFace": "FACE_MATCH"
}
```
--------------------------------
### Implement Face Capture Oval V3
Source: https://documentation.idenfy.com/mobile/iOS/migration-guide/ios-migrations
Replaces the deprecated face oval component with the new IdenfyFaceOvalV3 class. Includes initialization and constraint setup for integration within FaceCameraViewableV2.
```Swift
public var idenfyUIViewFaceOvalV3: IdenfyFaceOvalV3? = {
let view = IdenfyFaceOvalV3(frame: .zero)
view.translatesAutoresizingMaskIntoConstraints = false
view.isOpaque = false
return view
}()
func setupUIViewFaceOval() {
if let unwrappedIdenfyUIViewFaceOvalV3 = idenfyUIViewFaceOvalV3 {
addSubview(unwrappedIdenfyUIViewFaceOvalV3)
unwrappedIdenfyUIViewFaceOvalV3.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
unwrappedIdenfyUIViewFaceOvalV3.bottomAnchor.constraint(equalTo: cameraSessionsButtons.idenfyUIViewContainerOfButtons.topAnchor).isActive = true
let top = CameraSessionUIHelper.getDrawerHeight()
unwrappedIdenfyUIViewFaceOvalV3.topAnchor.constraint(equalTo: topAnchor, constant: top).isActive = true
unwrappedIdenfyUIViewFaceOvalV3.leftAnchor.constraint(equalTo: leftAnchor).isActive = true
unwrappedIdenfyUIViewFaceOvalV3.rightAnchor.constraint(equalTo: rightAnchor).isActive = true
unwrappedIdenfyUIViewFaceOvalV3.setNeedsDisplay()
}
}
```
--------------------------------
### Configure iDenfy SDK V2 with Auth Token (Objective-C)
Source: https://documentation.idenfy.com/mobile/iOS/ios-sdk
This Objective-C code snippet shows how to configure the iDenfy SDK V2 using an authentication token. It utilizes IdenfyBuilderV2 to construct the settings and then initializes the SDK through the IdenfyController.
```objectivec
IdenfyBuilderV2 *idenfyBuilderV2 = [[IdenfyBuilderV2 alloc] init];
idenfyBuilderV2 = [idenfyBuilderV2 withAuthToken:authToken];
IdenfySettingsV2 *idenfySettingsV2 = [idenfyBuilderV2 build];
IdenfyController *idenfyController = [IdenfyController shared];
[idenfyController initializeIdenfySDKV2WithManualWithIdenfySettingsV2:idenfySettingsV2];
```
--------------------------------
### Configure Additional Steps for Verification Token
Source: https://documentation.idenfy.com/API/AdditionalSteps
Examples for controlling which additional steps are included when generating a new verification token. This allows for disabling all steps, selecting specific steps, or providing granular configuration for individual steps.
```JSON
// Disable all additional steps
"additionalSteps": {
"ALL": {
"ALL": {}
}
}
```
```JSON
// Include only specific additional steps
"additionalSteps": {
"ALL": {
"ALL": ["ADDITIONAL_DOCUMENT"]
}
}
```
```JSON
// Granular configuration for a specific step
{
"clientId": "1",
"additionalSteps": {
"ALL": {
"ALL": {
"UTILITY_BILL": {
"type": "COMPARE",
"texts": {
"en": {
"name": "YOUR_PROVIDED_NAME_FOR_SECTION",
"description": "YOUR_EXPLANATION_OF_THE_SECTION"
}
},
"fields": ["address"],
"settings": {
"canUpload": false,
"canCapture": true,
"canUploadPDF": false
}
}
}
}
}
}
```
--------------------------------
### Beneficiary Document List JSON Response Sample
Source: https://documentation.idenfy.com/KYB/KYBIntegration/kybCollectInformation
Example JSON structure for a list of beneficiary documents, each containing an ID, type, filename, and a URL to the file.
```JSON
[
{
"id": "string",
"type": "IDENTITY_DOCUMENT",
"filename": "string",
"file": "http://example.com"
}
]
```
--------------------------------
### Add iDenfySDK with Liveness via CocoaPods (Podfile)
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
Add this line to your Podfile to integrate the iDenfySDK with the Advanced Liveness detection feature using CocoaPods. This enables liveness checks in your identity verification flow.
```ruby
pod 'iDenfySDK/iDenfyLiveness', '8.8.0'
```
--------------------------------
### Handle Verification Results using Activity Result Contract in Kotlin
Source: https://documentation.idenfy.com/mobile/Android/android-sdk
This snippet demonstrates how to register an ActivityResultContract to listen for identification results. It extracts the IdenfyIdentificationResult object and processes both auto and manual identification statuses.
```kotlin
var identificationResultsCallback = registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { result: ActivityResult ->
val resultCode = result.resultCode
val data = result.data
if (resultCode == IdenfyController.IDENFY_IDENTIFICATION_RESULT_CODE) {
val idenfyIdentificationResult: IdenfyIdentificationResult = data!!.getParcelableExtra(
IdenfyController.IDENFY_IDENTIFICATION_RESULT
)!!
when (idenfyIdentificationResult.manualIdentificationStatus) {
ManualIdentificationStatus.APPROVED -> { /* Handle Approved */ }
ManualIdentificationStatus.FAILED -> { /* Handle Failed */ }
ManualIdentificationStatus.WAITING -> { /* Handle Waiting */ }
ManualIdentificationStatus.INACTIVE -> { /* Handle Inactive */ }
}
when (idenfyIdentificationResult.autoIdentificationStatus) {
AutoIdentificationStatus.APPROVED -> { /* Handle Approved */ }
AutoIdentificationStatus.FAILED -> { /* Handle Failed */ }
AutoIdentificationStatus.UNVERIFIED -> { /* Handle Unverified */ }
}
Toast.makeText(
this@MainActivity,
"Auto - ${idenfyIdentificationResult.autoIdentificationStatus} \n" +
"Manual - ${idenfyIdentificationResult.manualIdentificationStatus} \n",
Toast.LENGTH_LONG
).show()
}
}
```
--------------------------------
### Present iDenfy ViewController using UIKit (Objective-C)
Source: https://documentation.idenfy.com/mobile/iOS/ios-sdk
This Objective-C code snippet illustrates how to present the iDenfy SDK's ViewController in a UIKit application. It retrieves an IdenfyController instance, instantiates the navigation controller, and presents it modally.
```objectivec
UINavigationController *idenfyVC = [idenfyController instantiateNavigationController];
[self presentViewController:idenfyVC animated:YES completion:nil];
```
--------------------------------
### Add iDenfy SDK Dependency to Project Gradle
Source: https://documentation.idenfy.com/mobile/Android/android-sdk
Add the JitPack repository to your root-level Gradle file to enable dependency resolution for the iDenfy SDK. This is a prerequisite for adding the SDK dependency to your app module.
```gradle
repositories {
maven { url 'https://jitpack.io' }
}
```
--------------------------------
### Add Base iDenfySDK via Swift Package Manager (URL)
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
This is the URL to add the base iDenfySDK package to your Xcode project using Swift Package Manager. It provides the core functionality for identity verification.
```swiftpm
https://github.com/idenfy/iDenfySDK-spm.git
```
--------------------------------
### Initialize SDK with Manual Verification Flow (V2)
Source: https://documentation.idenfy.com/android-updates/2025/03/03/Android-update
This code snippet shows the preferred method for initializing the Idenfy SDK for manual verification flows using the V2 API. It replaces the deprecated `startActivityForResultV2` method and is part of the SDK's ongoing updates to improve initialization and lifecycle management.
```kotlin
initializeIdenfySDKV2WithManual(...)
```
--------------------------------
### Add iDenfySDK with Blur/Glare Detection via CocoaPods (Podfile)
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
Include this line in your Podfile to add the iDenfySDK with Advanced Liveness detection and Document blur/glare detection features via CocoaPods. This improves the accuracy of document analysis.
```ruby
pod 'iDenfySDK/iDenfyBlurGlareDetection', '8.8.0'
```
--------------------------------
### Add iDenfySDK with Liveness via Swift Package Manager (URL)
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
This URL allows you to add the iDenfySDK with the Advanced Liveness detection feature to your project via Swift Package Manager. This enhances the verification process with liveness checks.
```swiftpm
https://github.com/idenfy/iDenfyLiveness-spm.git
```
--------------------------------
### Spring Boot Application Main Method (Java)
Source: https://documentation.idenfy.com/KYC/KYCLanding
This Java code snippet shows the main method for a Spring Boot application. It initializes the application and starts the Spring Boot context, making the configured controllers and services available. It also includes logging for application startup.
```java
public static void main(String[] args) {
loggerApp.info("Starting Spring Boot Single File Application...");
// You might need to explicitly tell Spring where to scan for components if they are not picked up automatically.
// However, static inner classes annotated with @Component, @Service, @Controller in the main app class
// are usually picked up by Spring Boot's default component scan.
SpringApplication.run(IdenfyDemoSingleFileApplication.class, args);
loggerApp.info("Spring Boot Single File Application started. Access at http://localhost:8080/singlefile or http://localhost:8080/idenfy-test-spring-singlefile");
}
```
--------------------------------
### Retrieve Available Registry Reports Response
Source: https://documentation.idenfy.com/KYB/kybReports/kybRegistryReports
Example JSON response structure for the GET request to fetch available registry documents. It provides a list of products including metadata like price, currency, format, and ordering status.
```json
{
"products": [
{
"id": "EBROFF_MzA0NjE3NjIxO0xUVV9CUzs0OzQ7RlMwMTI5_TFRVX0JT_QmFsYW5jZSBzaGVldA==_MzA0NjE3NjIx",
"priceTag": "LTU_BS",
"price": "0",
"vatCharge": "0",
"currency": "€",
"productCode": "304617621;LTU_BS;4;4;FS0129",
"companyCode": "304617621",
"productDetails": [
{
"keyField": "EFFECTIVE_DATE",
"valueField": "2020-12-31",
"documentCountField": 0
}
],
"productFormat": "HTML",
"productTitle": "Balance sheet",
"displayDate": "2020-12-31",
"type": "BALANCE_SHEET",
"deliveryTimeMinutes": 5,
"tierCode": "A",
"tierValue": "1.00",
"status": "NOT_ORDERED",
"canOrder": true
}
]
}
```
--------------------------------
### Create IdenfyUISettingsV2 Instance
Source: https://documentation.idenfy.com/mobile/Android/android-ui-customization
This code snippet demonstrates how to create an initial instance of the IdenfyUISettingsV2 class using its builder pattern. This is the starting point for configuring UI settings.
```kotlin
val idenfyUISettingsV2 = IdenfyUISettingsV2.IdenfyUIBuilderV2()
.build()
```
--------------------------------
### Add iDenfySDK with Recognition via CocoaPods (Podfile)
Source: https://documentation.idenfy.com/mobile/IOS/ios-sdk
Add this line to your Podfile to include the iDenfySDK with Advanced Liveness, Document blur/glare detection, NFC Reading, and Document Auto Capture features via CocoaPods. This provides a comprehensive solution.
```ruby
pod 'iDenfySDK/iDenfyRecognition', '8.8.0'
```
--------------------------------
### Initialize iDenfy SDK in SwiftUI
Source: https://documentation.idenfy.com/mobile/iOS/ios-sdk
This Swift code defines a UIViewControllerRepresentable struct to integrate the iDenfy SDK into a SwiftUI view. It handles the SDK initialization with an authentication token and UI settings, then returns the SDK's navigation controller.
```swift
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()
}
}
```
--------------------------------
### Implement Custom Logging Handler in Kotlin
Source: https://documentation.idenfy.com/mobile/Android/android-logging-webhooks
Demonstrates how to create a custom logging implementation by extending IdenfyLoggingHandlerUseCase. This allows developers to capture SDK lifecycle events and navigation actions.
```Kotlin
class ConsoleLoggingImpl {
fun log(event: String, message: String, token: String) {
Log.d("fromIdenfySDK-$event", message)
}
}
class IdenfyLoggingHandlerUseCaseImpl(private var consoleLoggingImpl: ConsoleLoggingImpl):IdenfyLoggingHandlerUseCase {
override fun logEvent(event: String, message: String, token: String) {
consoleLoggingImpl.log(event, message, token)
}
}
val consoleLogging = ConsoleLoggingImpl()
IdenfyController.getInstance().idenfyLoggingHandler = IdenfyLoggingHandlerUseCaseImpl(consoleLogging)
```