Skip to main content

Getting started

Requirements

iOS

  • Deployment Target: iOS 11.0 or later

Android

  • minSdkVersion: 23 (Android 6.0 Marshmallow)
  • targetSdkVersion: 34 (Android 14.0 Upside-Down Cake)

Installation

Bare Workflow

  1. Install @tokenstreet/react-native-idnow-videoident:

    yarn add @tokenstreet/react-native-idnow-videoident --tilde

    or

    npm install @tokenstreet/react-native-idnow-videoident --save-exact
    versioning

    We do not follow Semantic Versioning 2.0.0 until v1 is landed. Breaking changes in minor updates are possible. Therefore, it is recommended to install this package with a locked minor version.

iOS

  1. Install the iOS dependencies:

    pod install
  2. Add the following properties to your Info.plist:

    <key>NSMicrophoneUsageDescription</key>
    <string>Allow microphone access for video identification</string>
    <key>NSCameraUsageDescription</key>
    <string>Allow camera access for video identification</string>

Android

  1. Add the IDnow maven url to your top-level build.gradle:

    allprojects {
    repositories {
    ...
    jcenter() {
    // JCenter is now read-only. Therefore, no new versions are published there any more.
    // We only fetch the necessary dependencies for IDnow from JCenter to avoid loading old dependencies.
    content {
    includeModule("me.relex", "circleindicator")
    includeModule("com.github.barteksc", "android-pdf-viewer")
    }
    }
    maven() {
    url "https://raw.githubusercontent.com/idnow/de.idnow.android/master"
    content {
    includeModule("de.idnow.sdk", "idnow-android-sdk")
    includeModule("de.idnow.insights", "idnow-android-insights-sdk")
    }
    }
    }
    }
  2. Add the following permissions to your AndroidManifest.xml (click here for more details):

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.FLASHLIGHT" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
  3. Unfortunately, it is not yet possible to customise the colours for Android via JavaScript. To edit them, please follow the official guide.

Expo

experimental

Please be aware that Expo support is experimental and not officially supported.

  1. Install @tokenstreet/react-native-idnow-videoident:

    npx expo install @tokenstreet/react-native-idnow-videoident expo-build-properties
  2. Open your app.json and update your plugins section (expo install would not do it for you, due to expo install skips scoped packages #17918):

    {
    "plugins": [
    [
    "@tokenstreet/react-native-idnow-videoident",
    {
    "android": {
    "excludeDuplicateClasses": false
    }
    }
    ],
    ["expo-build-properties", { "android": { "minSdkVersion": 23 } }]
    ]
    }

    All configuration options are explained below:

    NameTypeDefault ValueDescription
    android.excludeDuplicateClassesbooleanfalseThe following classes appeared twice in our projects in connection with this SDK, and can be excluded with this option: bcprov-jdk15to18, bcutil-jdk15to18, pdfium-android, android-pdf-viewer.

iOS

  1. Open your app.json and update the infoPlist to give your app the necessary permissions:

    {
    "ios": {
    "infoPlist": {
    "NSCameraUsageDescription": "Allow camera access for video identification",
    "NSMicrophoneUsageDescription": "Allow microphone access for video identification"
    }
    }
    }

Android

  1. Open your app.json and update the permissions to give your app the necessary permissions:

    {
    "android": {
    "permissions": [
    "android.permission.ACCESS_NETWORK_STATE",
    "android.permission.INTERNET",
    "android.permission.WRITE_EXTERNAL_STORAGE",
    "android.permission.CAMERA",
    "android.permission.FLASHLIGHT",
    "android.permission.MODIFY_AUDIO_SETTINGS",
    "android.permission.RECORD_AUDIO",
    "android.permission.BLUETOOTH",
    "android.permission.BLUETOOTH_ADMIN"
    ]
    }
    }

Usage

startVideoIdent is asynchronous. For a successful identification the resultCode is returned directly. If the identification failed, an error is thrown with a resultCode. Also, an optional errorMessage can be included.

You have the possibility to integrate it with a try...catch block, with Promises or with callbacks:

import type { IIdentificationErrorResult } from '@tokenstreet/react-native-idnow-videoident';
import { IdnowManager } from '@tokenstreet/react-native-idnow-videoident';

try {
const { resultCode } = await IdnowManager.startVideoIdent({ transactionToken: 'YOUR_TRANSACTION_TOKEN' });
console.log(resultCode);
} catch (error) {
if (error !== null && typeof error === 'object' && 'resultCode' in error) {
const identificationError = error as IIdentificationErrorResult;
console.log(identificationError.resultCode);
console.log(identificationError.errorMessage);
}
}

All configuration options are documented in the TypeScript interfaces and an example is also available.