React Native

⚛️ React Native Setup

🛠 Prerequisites

Before integrating the SDK, make sure your development environment is set up.

  • react-native >= 0.69.5
  • Node.js v18+
  • Android Studio (SDK 23+)
  • iOS: Xcode 13+, physical iOS device (arm64 only)
  • Required npm packages:
    • react-native-relid-idv-document-capture
    • `react-native-relid-idv-selfie-capture

Required Modules

npm install ./react-native-relid-idv-document-capture
npm install ./react-native-relid-idv-selfie-capture

Place SDK Files

  • Place the folders for react-native-relid-idv-document-capture and react-native-relid-idv-selfie-capture in the root of your project.
  • Place regula.license, db.dat, and Certificates.bundle in the appropriate assets folders for Android and iOS.

Configuration

  • Ensure react-native >= 0.69.5
  • Android:
    • Android Studio (latest)
    • SDK 23+ with Jetpack
  • iOS:
    • Xcode 13+
    • Platform version: platform :ios, '13.0'
    • Physical arm64 iOS device


🤖 Additional Configurations for React Native (Android)

The following configurations are mandatory to integrate the REL-ID IDV Document Capture Module on Android for React Native apps.


1. 📦 Add the IDV npm dependencies

In your project-levelbuild.gradle, add the following flatDir repositories under allprojects.repositories:

allprojects {
    repositories {
        google()
        maven { url("$rootDir/../node_modules/react-native/android") }

        // For IDV Document Capture module
        flatDir {
            dirs "$rootDir/../node_modules/react-native-relid-idv-document-capture/android/libs"
        }

        // For IDV Selfie Capture module
        flatDir {
            dirs "$rootDir/../node_modules/react-native-relid-idv-selfie-capture/android/libs"
        }
    }
}

2. 📄 REL-ID IDV Document Capture Module License

  • Copy the regula.license file provided by the UNIKEN team to the following path:
android/app/src/main/res/raw/
🔧

Create the raw folder if it doesn't exist.


3. 🗃️ REL-ID IDV Document Capture Module Database File

  • Copy the db.dat file to the following location:
android/app/src/main/assets/Regula/
🔧

Create the Regula folder inside assets if it doesn't exist.


4. 🔐 REL-ID IDV Document Capture Module PKD Certificate File

  • Copy the PKD certificate (*.ldif file) to:
android/app/src/main/assets/certificates/
🔧

Create the certificates folder inside assets if it doesn't exist.



📦 Additional Configurations for React Native (iOS)

The following configurations are mandatory to integrate the REL-ID IDV Document Capture Module on iOS for React Native apps.


1. 🛡️ Permissions

You must add the following keys to your Info.plist file:

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

<key>NFCReaderUsageDescription</key>
<string>NFC tag to read NFC document data</string>

<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
  <string>A0000002471001</string>
  <string>E80704007F00070302</string>
  <string>A000000167455349474E</string>
  <string>A0000002480100</string>
  <string>A0000002480200</string>
  <string>A0000002480300</string>
  <string>A00000045645444C2D3031</string>
</array>

Also, enable NFC capabilities for your app:

  • Open project in Xcode
  • Go to Signing & Capabilities
  • Click on + Capability
  • Add Near Field Communication Tag Reading

2. 📄 REL-ID IDV Document Capture Module License

To integrate the module:

  • Share your app’s bundle ID with the UNIKEN team to get the regula.license file.
  • Copy the regula.license file to your .xcodeproj directory.
  • Drag and drop the file into the Xcode project navigator to ensure it's bundled with the app.

3. 🗃️ REL-ID IDV Document Capture Module Database File

Steps:

  • Copy the db.dat file to your .xcodeproj directory.
  • Drag and drop the file into the Xcode project navigator so that it’s bundled with the app.

4. 🔐 REL-ID IDV Document Capture Module PKD Certificate File

Steps:

  • Copy the Certificates.bundle folder to the .xcodeproj directory.
  • Drag and drop the folder into your Xcode project navigator so that it’s bundled with the app.

📦 Build and Run Project

This section provides instructions to build and run your project integrated with the REL-ID IDV SDK.


✅ Prerequisites

Ensure:

  • All REL-ID IDV SDK modules are installed correctly.
  • There are no compile-time errors in your code.
TaskCommand
Build and run Androidreact-native run-android
Build and run iOSreact-native run-ios

⚠️ Important Notes

  • The REL-ID IDV SDK supports physical devices only for testing. Simulators/emulators are not supported.
  • Make sure the following files are correctly placed and bundled:
    • regula.license
    • db.dat
    • PKD Certificate (.ldif for Android, Certificates.bundle for iOS)