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
Install the module directly from GitHub with npm. No Google Drive download is required — the native module is autolinked.
Shellnpm install git+https://github.com/Idmission-LLC/react-native-idmission-sdk.git#v11.1.19The#v11.1.19suffix pins the install to the release tag. Do not trackmain. -
2
Set up CocoaPods. Update
ios/Podfile(replaceYourAppNamewith your target's name), then install the pods.ios/Podfilerequire 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 endShellcd ios LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 pod install cd ..TheLANG/LC_ALLprefixes avoid the CocoaPodsUnicode Normalizationerror on non-UTF-8 terminals.Xcode 26 / Swift 6.3: thefmtpatch inpost_installabove is required. Without it the build fails with afmtconsteval error.Upgrading from the zip install? See Upgrading from the zip install for the Podfile lines to remove. -
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
Build and run on a physical device.
Shellnpm run iosThe 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.
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();
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'.
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)
}
);Returns a Promise with the native SDK version and the ML model names in use. models is empty until the SDK has been initialized.
const { version, models } = await IDMissionSDK.getSDKInfo();
// models: [{ name: 'Face Detector', value: 'face_detection_full_range_sparse.tflite' }, ...]Initiates the ID Validation (Service ID 20) flow. Captures and validates a government-issued ID document.
IDMissionSDK.serviceID20();
IDMissionSDK.submitResult();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.
IDMissionSDK.serviceID10();
IDMissionSDK.submitResult();Initiates the Identify Customer (Service ID 185) flow.
IDMissionSDK.serviceID185();
IDMissionSDK.submitResult();Initiates the Live Face Check (Service ID 660) flow. Performs liveness detection without document capture.
IDMissionSDK.serviceID660();
IDMissionSDK.submitResult();Initiates the ID Validation and Customer Enroll (Service ID 50) flow. Pass your unique customer number.
IDMissionSDK.serviceID50(uniqueCustomerNumber); // string
IDMissionSDK.submitResult();Initiates the Customer Enroll Biometrics (Service ID 175) flow.
IDMissionSDK.serviceID175(uniqueCustomerNumber); // string
IDMissionSDK.submitResult();Initiates the Customer Verification (Service ID 105) flow.
IDMissionSDK.serviceID105(uniqueCustomerNumber); // string
IDMissionSDK.submitResult();Submits the captured data and finalizes the current service flow. Call after every service.
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
Install the package as shown in Step 1.
- 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.swiftandUserDefaults+IDentitySample.swift. Also remove#import "IDMissionSDK.h"from your bridging header. - 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-typeslines or anySWIFT_ENABLE_EXPLICIT_MODULESpatch. Then reinstall the pods:Shellcd ios rm -rf Pods Podfile.lock LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 pod install --repo-update cd .. - 4
Import the module from the package instead of
NativeModules:import { IDMissionSDK, addDataCallbackListener } from 'react-native-idmission-sdk';. Your existinginitializeSDKcall and the rest of your code keep working.Then rebuild with
npm run iosand test one service on a device.