Android React Native Wrapper
Integrate IDmission's IDentity SDK into your Android 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
- Java 17 — use JDK 17 or newer
- minSdk 26 (Android 8.0) and compileSdk 36 — required by the IDmission native SDK
- A physical Android device — the emulator 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
Add the IDmission Maven repository to your project-level
android/build.gradle. The native SDK is published to IDmission's private GitLab registry.android/build.gradleallprojects { repositories { google() mavenCentral() maven { url "https://gitlab.idmission.com/api/v4/projects/220/packages/maven" name "GitLab" credentials(HttpHeaderCredentials) { name = "Private-Token" value = "WESesyuSD9fQeqNEyig6" } authentication { header(HttpHeaderAuthentication) } } // Required for fingerprint capture maven { url 'https://jitpack.io' } } } -
3
Confirm your SDK versions and multidex. Set these in
android/build.gradle(ext) and your app module'sandroid/app/build.gradle.android/build.gradlebuildscript { ext { minSdkVersion = 26 // required — manifest merge fails below 26 compileSdkVersion = 36 targetSdkVersion = 36 } }Ensure multidex is enabled in your app module:
android/app/build.gradleandroid { defaultConfig { multiDexEnabled true } } -
4
Connect a physical Android device and run the application.
Shellnpm run androidThe IDentity SDK requires a physical device — the Android Emulator 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 ReactNativeSDK2AndroidResources.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
Delete
IDMissionSDK.javaandIDMissionPackage.javafrom your app, and remove theadd(IDMissionPackage())line fromMainApplication. The module is now registered automatically. - 3
Remove the
idmission-mediumsdkdependency line fromandroid/app/build.gradle; the module adds it. Keep the IDmission Maven repository (Step 2). It has not changed. - 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 androidand test one service on a device.