# React Native

Version 1.31.2

# Preparing to work with plugins

To use any of our plugins, you must first obtain an accessToken.

  1. In the IDnGO Dashboard, generate an appToken and secretKey.
  2. Use them to make an API request to obtain an accessToken.
    Detailed instructions
  3. Use the obtained token when initializing the SDK.

# Installation

  1. Create a .npmrc file in the root of the project and specify the repository URL for packages in it:
  1. In the command line, run:

The dependency will be automatically added to package.json:

  1. Add dependencies on our MobileSDK to the iOS and Android parts of the application:

# Android

  • API level 23 (Android 5.0) or newer
  • Kotlin 1.9.25 or newer

Add the repository to android/build.gradle:

# iOS

Warning:

Make sure Bitcode is disabled in your project.

  1. Add the following to the top of ios/Podfile:
  1. After installing the package, run the command:

Tip:

If you encounter a compatibility error like «CocoaPods could not find compatible versions for pod "CyberityMobileSDK"», run:

# Hardware feature access

The framework will request access to the camera and microphone, photo gallery, and geolocation. Therefore, you must have corresponding usage descriptions in the application's Info.plist file. The description texts can be changed according to your requirements.

# Initialization

# Configuration

Import the class in your application code:

The cbrMobileSDK.launch() method returns a Promise of a Result object, which contains the SDK status when it closes.

Result Object

An object describing the result of the last SDK launch:

Field Type Description
success Boolean TRUE — no errors, FALSE — an error occurred.
status String SDK status.
errorType String Error type.
errorMsg String Detailed error description.

# Launching the SDK

You can then use launchCBRMobileSDK() to start the SDK.

# Closing the SDK

By default, once the user is approved, the SDK automatically closes after 3 seconds. You can adjust this time interval or disable automatic closing by setting it to 0:

To close the SDK programmatically, use:

# Additional settings

# User data

If necessary, you can pass an email and/or phone number that will be initially assigned to the user.

# Preferred documents

For IDENTITY* steps (document verification), you can specify the country and document type that will be automatically selected, bypassing the document type selection screen.

Please note that the passed parameters will only be applied if the corresponding combination of country and document type (idDocType) is allowed at that step according to the level settings.

# Localization

You can customize the texts used in the SDK in the «SDK Integrations» section of the Dashboard.

The text language will be set according to the system settings, but you can change it to your desired language.

To override the system language:

# Text strings

Part of the text can be set locally and persist when the SDK language settings change. For example, for situations where the translation server is unavailable due to lack of internet, but you need to guarantee that certain text is displayed, local string management is used.

# Analytics

The SDK collects and sends usage data to IDnGO servers. We do not track sensitive data; only general usage statistics are sent. This includes screen navigation, interaction with UI elements, and so on.

We analyze this data to improve IDnGO. The data is not shared with third parties and is not used for advertising.

To disable data analytics, use:

# Events

SDK events can be received via onEvent:

Each event contains an eventType and a set of parameters packed into a payload dictionary.

eventType Field Values

Event Type Payload Description
ApplicantLoaded
{
"applicantId": "$applicantId"
}
The user's application has been loaded.
StepInitiated
{
"idDocSetType": "$idDocSetType"
}
Verification step initiated.
StepCompleted
{
"idDocSetType": "$idDocSetType",
"levelName": "$levelName",
"isCancelled": false
}
Verification step completed or cancelled.
Analytics
{
"eventName": "$eventName",
"eventPayload": object
}
An analytics event occurred.

# Applicant actions

To use the SDK in applicant action mode, you need to create a verification level with the «Applicant Action» verification step (see more).

The access token is created with the userId, levelName, and externalActionId parameters.

# API Reference

# SDK Statuses

Status Description
Ready SDK is initialized and ready to launch.
Failed SDK terminated with an error.
Initial No verification steps have been completed yet.
Incomplete Part of the verification steps have been completed.
Pending Awaiting user verification.
TemporarilyDeclined Temporary rejection.
FinallyRejected Final rejection.
Approved The user's application has been approved.

# Error Types errorType

Error Description
Unknown Unknown error.
InvalidParameters Invalid parameters.
Unauthorized Unauthorized access (invalid or expired token).
InitialLoadingFailed Initial loading from the server failed.
ApplicantNotFound User application not found.
ApplicantMisconfigured User application found, but configuration is incorrect (e.g., missing idDocs).
InitializationError Initialization error.
NetworkError Network error (user sees the «Network Oops» screen).
UnexpectedError Unexpected error («Fatal Oops» screen).