React Native

⚙️ Prerequisites for Integration – React Native

Before integrating the Ditto ID API SDK into your React Native app, ensure the following prerequisites are met:


🧱 Project Environment

ComponentRequirement
React Native VersionCompatible with node-module.
Android StudioLatest version
XcodeVersion 14.3 or higher

📱 Android Requirements

  • Minimum SDK Version: 23 or higher
  • Target SDK Version: 35
  • AGP (Android Gradle Plugin) Version:
    • Current: 7.4
    • Supported Range: 7.3.0 to 7.4.2

    🔌 Proxy Configuration (if needed)

    If you're working behind a proxy:
    • Set proxy in Android Studio via:
      File > Settings > System Settings > HTTP Proxy
    • If proxy settings aren't working, manually set them in:
      ~/.gradle/gradle.properties
    • Also configure proxy settings for:
      • npm
      • git

🍏 iOS Requirements

  • Xcode Version: 14.3 or higher
  • Deployment Target: iOS 12.0 or above
  • Architectures Supported: arm64 and x86_64 only
    (Bitcode is not supported)

🔐 SDK Artifacts & Info Required (From Ditto ID Admin)

ItemDescription
Agent_info.txtBinary file containing the application ID for Ditto ID initialization
Ditto ID Gateway InfoHostname/IP and Port number where Ditto ID Gateway is running
RDNA_Client node module Plugin FolderProvided by Ditto Team, includes platform-specific plugin files and libraries

💡 Notes

  • Refer to the Installation Guide below for detailed installation and configuration steps.
  • Network proxy setup might be required depending on your studio environment.

⚙️ Ditto ID SDK Installation Guide for React Native

This guide provides official steps to integrate the Ditto ID API SDK Node Module into a React Native project.


📁 1. Node Module Structure

Extract the react-native-rdna-client.zip provided by Ditto team. It includes:

  • Android/ – Android .aar and source files
  • iOS/ – iOS source files
  • src/ – Contains index.tsx, rdnastruct.tsx with APIs, enums, and structures

📥 2. Install the Ditto ID Node Module

Place the extracted folder in your project root, then run:

npm i ./react-native-rdna-client
🔧

If you're using React Native ≤ v0.69.x, update metro.config.js:

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        inlineRequires: true,
      },
    }),
  },
};

🤖 3. Android Configuration

🔧 Add .aar Support in android/build.gradle

Under allprojects → repositories:

allprojects {
  repositories {
    google()
    maven { url("$rootDir/../node_modules/react-native/android") }
    flatDir {
      dirs "$rootDir/../node_modules/react-native-rdna-client/android/libs"
    }
  }
}

📦 Add packagingOptions for .so Conflicts

In android/app/build.gradle:

android {
  ...
  packagingOptions {
    pickFirst '**/armeabi/libc++_shared.so'
    pickFirst '**/armeabi-v7a/libc++_shared.so'
    pickFirst '**/x86/libc++_shared.so'
    pickFirst '**/arm64-v8a/libc++_shared.so'
    pickFirst '**/x86_64/libc++_shared.so'
  }
}

Add Permissions

The Ditto ID API SDK and Mobile Threat Detection (MTD) modules require a predefined set of Android permissions to operate securely and effectively.


🍏 4. iOS Configuration

📦 Run CocoaPods

cd ios
pod install
cd ..

🛠 Update Info.plist

Ensure the following is included:

<key>Bundle name</key>
<string>$(PRODUCT_NAME)</string>
<key>Bundle display name</key>
<string>$(PRODUCT_NAME)</string>

Also, ensure your target's Build Settings includes the correct product name.

📋 Info.plist Permissions

To enable the full functionality of the Ditto ID SDK—including identity verification, biometric authentication, geolocation-based risk analysis, and local network verification—your iOS app must declare specific permissions in the Info.plist file.

✅ You’re now ready to initialize and integrate the Ditto ID SDK in your React Native application!



What’s Next

Install the Ditto ID SDK in your React Native project

Did this page help you?