iOS React Native Wrapper

Integrate IDmission's IDentity SDK into your iOS React Native application.

Prerequisites

  • React Native 0.83 or later (bare workflow or a custom dev client — not Expo Go) — React Native environment setup →
  • Node 20 or later
  • iOS deployment target 15.6 and a recent Xcode
  • CocoaPods
  • A physical iOS device — the simulator does not support camera capture

Setup

  1. 1

    Install the module directly from GitHub with npm. No Google Drive download is required — the native module is autolinked.

    Shell
    npm install git+https://github.com/Idmission-LLC/react-native-idmission-sdk.git#v11.1.19
    The #v11.1.19 suffix pins the install to the release tag. Do not track main.
  2. 2

    Set up CocoaPods. Update ios/Podfile (replace YourAppName with your target's name), then install the pods.

    ios/Podfile
    require Pod::Executable.execute_command('node', ['-p',
      'require.resolve(
        "react-native/scripts/react_native_pods.rb",
        {paths: [process.argv[1]]},
      )', __dir__]).strip
    
    platform :ios, '15.6'
    prepare_react_native_project!
    
    # NOTE: do NOT add `use_modular_headers!` here — it creates a circular module
    # dependency that hides the wrapper's Swift class from Objective-C.
    target 'YourAppName' do
      config = use_native_modules!
    
      pod 'IDentityMediumSDK2.0'
    
      use_react_native!(
        :path => config[:reactNativePath],
        :app_path => "#{Pod::Config.instance.installation_root}/.."
      )
    
      post_install do |installer|
        react_native_post_install(
          installer,
          config[:reactNativePath],
          :mac_catalyst_enabled => false
        )
    
        # Xcode 26 / Clang 21: disable fmt consteval, else the build fails with
        # "Call to consteval function 'fmt::basic_format_string...'".
        fmt_base = File.join(__dir__, 'Pods', 'fmt', 'include', 'fmt', 'base.h')
        if File.exist?(fmt_base)
          text = File.read(fmt_base)
          original = "#if !defined(__cpp_lib_is_constant_evaluated)\n#  define FMT_USE_CONSTEVAL 0"
          replacement = "#if 1 // Podfile patch: disable fmt consteval (Xcode 26 / Clang 21)\n#  define FMT_USE_CONSTEVAL 0"
          if text.include?(original)
            File.write(fmt_base, text.sub(original, replacement))
          end
        end
      end
    end
    Shell
    cd ios
    LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 pod install
    cd ..
    The LANG / LC_ALL prefixes avoid the CocoaPods Unicode Normalization error on non-UTF-8 terminals.
    Xcode 26 / Swift 6.3: the fmt patch in post_install above is required. Without it the build fails with a fmt consteval error.
    Upgrading from the zip install? See Upgrading from the zip install for the Podfile lines to remove.
  3. 3

    Add the required camera, microphone, and photo-library permission strings to ios/YourAppName/Info.plist. A missing key causes an immediate crash on iOS 14+.

    Info.plist
    <key>NSCameraUsageDescription</key>
    <string>Camera access is required to capture identity documents and verify your face.</string>
    
    <key>NSMicrophoneUsageDescription</key>
    <string>Microphone access may be required during identity verification.</string>
    
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Photo library access is required to select identity documents for verification.</string>
  4. 4

    Build and run on a physical device.

    Shell
    npm run ios
    The IDentity SDK requires a physical device — the iOS Simulator does not support camera capture and will not run the SDK flows.

Available Functions

Import the module and follow this pattern. Results for every call are delivered asynchronously through the DataCallback event.

JavaScript — usage pattern
import { IDMissionSDK, addDataCallbackListener } from 'react-native-idmission-sdk';

// 1. Subscribe to results (init, services, and submit all emit here)
const subscription = addDataCallbackListener((event) => {
  console.log('IDmission result:', event.data);
});

// 2. Initialise once before calling any service
IDMissionSDK.initializeSDK(apiBaseUrl, accessToken);

// 3. Call a service
IDMissionSDK.serviceID10();

// 4. Submit the result
IDMissionSDK.submitResult();

// 5. Clean up when done
subscription.remove();
InitIDMissionSDK.initializeSDK

Initializes the SDK. Must be called before any other function. The earlier form initializeSDK(apiBaseUrl, authUrl, debug, accessToken) also still works, with debug set to 'y' or 'n'.

JavaScript
IDMissionSDK.initializeSDK(
  apiBaseUrl,   // string — API base URL, provided by IDmission
  accessToken,  // string — your IDmission access token
  {             // options — optional, these are the defaults
    language: 'en',                // 'en' or 'es' (Android also 'my' and 'ar')
    enableGPS: true,               // capture GPS location with submissions
    geolocationRequired: false,    // block the flow if location access is denied
    isUpdateModelsData: true,      // download the latest SDK models after credential verification
    enableScreenRecording: false,  // allow screen recording / screenshots
    enableDebugMode: false         // verbose SDK logging (use false in production)
  }
);
InfoIDMissionSDK.getSDKInfo

Returns a Promise with the native SDK version and the ML model names in use. models is empty until the SDK has been initialized.

JavaScript
const { version, models } = await IDMissionSDK.getSDKInfo();
// models: [{ name: 'Face Detector', value: 'face_detection_full_range_sparse.tflite' }, ...]
ServiceIDMissionSDK.serviceID20

Initiates the ID Validation (Service ID 20) flow. Captures and validates a government-issued ID document.

JavaScript
IDMissionSDK.serviceID20();
IDMissionSDK.submitResult();
ServiceIDMissionSDK.serviceID10

Initiates the ID Validation and Match Face (Service ID 10) flow. Captures an ID document and matches a live selfie to the photo on the ID.

JavaScript
IDMissionSDK.serviceID10();
IDMissionSDK.submitResult();
ServiceIDMissionSDK.serviceID185

Initiates the Identify Customer (Service ID 185) flow.

JavaScript
IDMissionSDK.serviceID185();
IDMissionSDK.submitResult();
ServiceIDMissionSDK.serviceID660

Initiates the Live Face Check (Service ID 660) flow. Performs liveness detection without document capture.

JavaScript
IDMissionSDK.serviceID660();
IDMissionSDK.submitResult();
ServiceIDMissionSDK.serviceID50

Initiates the ID Validation and Customer Enroll (Service ID 50) flow. Pass your unique customer number.

JavaScript
IDMissionSDK.serviceID50(uniqueCustomerNumber); // string
IDMissionSDK.submitResult();
ServiceIDMissionSDK.serviceID175

Initiates the Customer Enroll Biometrics (Service ID 175) flow.

JavaScript
IDMissionSDK.serviceID175(uniqueCustomerNumber); // string
IDMissionSDK.submitResult();
ServiceIDMissionSDK.serviceID105

Initiates the Customer Verification (Service ID 105) flow.

JavaScript
IDMissionSDK.serviceID105(uniqueCustomerNumber); // string
IDMissionSDK.submitResult();
SubmitIDMissionSDK.submitResult

Submits the captured data and finalizes the current service flow. Call after every service.

JavaScript
IDMissionSDK.submitResult();

Upgrading from the zip install

If your app was set up from ReactNativeSDK2iOSResources.zip, switch to the GitHub package. It replaces the files you copied from the zip.

  1. 1

    Install the package as shown in Step 1.

  2. 2

    Remove the files you added from the zip from your Xcode project: IDMissionSDK.h, IDMissionSDK.m, IDentitySDKHelper.swift, ViewController.swift, MainViewController.h, MainViewController.m, SuccessViewController.swift and UserDefaults+IDentitySample.swift. Also remove #import "IDMissionSDK.h" from your bridging header.

  3. 3

    Update your Podfile to match Step 2. The SDK no longer needs the GZIP and Google ML Kit pods, the cocoapods-user-defined-build-types lines or any SWIFT_ENABLE_EXPLICIT_MODULES patch. Then reinstall the pods:

    Shell
    cd ios
    rm -rf Pods Podfile.lock
    LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 pod install --repo-update
    cd ..
  4. 4

    Import the module from the package instead of NativeModules: import { IDMissionSDK, addDataCallbackListener } from 'react-native-idmission-sdk';. Your existing initializeSDK call and the rest of your code keep working.

    Then rebuild with npm run ios and test one service on a device.