Android SDK Integration
Introduction
This document serves as a comprehensive guide for Android developers to seamlessly integrate Nashid Verify SDK into their applications. By following the step-by-step instructions provided, developers can simplify the process of scanning Oman ID cards and passports, and efficiently retrieve document scan results.
Nashid Verify SDK is designed to streamline identity verification processes, ensuring a smooth integration experience across platforms.
Prerequisites
Android:
- Android Studio Arctic Fox (2020.3.1) or higher
- Minimum SDK version: 21 (Android 5.0)
- Kotlin version: 1.9.24
- Java Development Kit (JDK) 17
- Gradle 8.0 or higher
Installation
Android:
- Add the Maven Central repository to your project's root
build.gradle
repositories {
mavenCentral()
}
- Add the SDK dependency to your app's
build.gradle
dependencies {
// Nashid Verify SDK
implementation 'io.nashid.verify:sdk:latest_version'
// Koin Dependency Injection (Required)
implementation 'io.insert-koin:koin-android:3.4.0'
}
Note: Koin is required for the SDK's dependency injection functionality. Make sure to use the specified version for compatibility.
- Recommendation to follow in your app's
build.gradle
includes these configurations:
android {
compileSdk 36
defaultConfig {
minSdk 21
targetSdk 36
}
}
Usage
1. Import Nashid Verify SDK:
Android:
// Add this to your build.gradle on module level with reference to latest version
implementation 'io.nashid.verify:sdk:x.y.z'
// Import dependencies in your project for usage in any class
import nashid.verify.sdk.VerifySDKManager;
2. Initialize Nashid Verify SDK:
To start using the SDK, you need to create an SDK Application and configure the desired verification flow via your admin dashboard.
The initialize()
function expects the following arguments:
- SDK Application Key (Mandatory): The key generated using your Nashid Verify admin dashboard.
- SDK Application Key Secret (Mandatory): The key secret generated using your Nashid Verify admin dashboard.
- Language Code (Optional):
en
for English (default),ar
for Arabic ..etc.
- Extra Data (Optional): An object of key-value pairs that you can use to annotate the verification data generated with additional data that your consumer application may need.
The initialize()
function returns a value, indicating whether initialization was successful (true
) or unsuccessful (false
), along with an error message in case of unsuccessful initialization.
Android:
VerifySDKManager.getInstance().initialize(
sdkKey = "YOUR_SDK_KEY",
sdkSecretKey = "YOUR_SECRET_KEY",
languageId = "en",
extraData = mapOf( // optional
"example-key" to "example-value"
),
callback = object : AuthCallback {
override fun initializeResponse(
result: Boolean?,
message: String?
) {
// 'result' indicates whether SDK initialization was successful (true) or not (false)
if (result == true) {
// Initialization successful
} else {
// Initialization failed
}
}
}
3. Verify A Document Using Nashid Verify SDK
Once Nashid Verify SDK is initialized successfully, you can start verifications journeys for your users using the verify()
function.
This function expects an input argument specifying the type of document to be verified
ID Type | Value |
OMANI_ID | 1 |
INTERNATIONAL_PASSPORT | 2 |
And as a result of the verification flow it returns three values:
- Result: A boolean flag that is true when the verification flow is successful, and false other wise.
- Error Message: A string contains the error details in case of unsuccessful verification.
- Verification ID: An ID of the created verification. This ID can be used later on to get the results collected with any additional checks/information annotated by backend services.
Example 1: Verify With Omani ID
VerifySDKManager.getInstance().verify(DocumentType.OMAN_ID);
Example 2: Verify With International Passport
VerifySDKManager.getInstance().verify(DocumentType.Passport);
4. Using Nashid Verify SDK To Get A Verification Result
Once you have a valid verification ID as an outcome of a successful verification journey you can use getVerificationResult()
function to get the results collected with any additional checks/information annotated by backend services using the verification ID.
Example: Retrieve the data of verification ID abcd1234
val scanResults = VerifySDKManager.getInstance().getVerificationResult(
verificationID: "abcd1234"
);
- The
verificationID
(abcd1234) is just an example value that represents what we get as a result of the verify functionality.
- Example ID Card Response:
{
"data": {
"id": "dummy-id-12345",
"created_at": "2025-01-01T00:00:00.000000+00:00",
"updated_at": "2025-01-01T00:01:00.000000+00:00",
"updated_by": null,
"data": {
"NFC": {
"issue_date": "2020-01-01",
"expiry_date": "2030-01-01",
"date_of_birth": "1990-01-01",
"gender_arabic": "ذكر",
"gender_english": "Male",
"identity_number": "12345678",
"full_name_arabic": "اسم عربي تجريبي",
"full_name_english": "JOHN DOE",
"nationality_arabic": "تجريبي",
"nationality_english": "DUMMYLAND",
"place_of_issue_arabic": "مكان الإصدار",
"place_of_issue_english": "Dummy City",
"country_of_birth_arabic": "بلد الميلاد",
"country_of_birth_english": "Dummyland"
},
"scan": {
"gender": "MALE",
"country": "DUM",
"mrz_text": "IDDUM1234567<<0<<<<<<<<<<<<<<<9001011M3001011DUM<<<<<<<<<<<0JOHN<DOE<TEST<DUMMY",
"full_name": "JOHN DOE TEST DUMMY",
"document_no": "1234567",
"expiry_date": "2030-01-01",
"nationality": "DUM",
"date_of_birth": "1990-01-01",
"document_type": "ID"
},
"liveness": {
"active_liveness_confirmed": true,
"passive_liveness_confirmed": false
}
},
"metadata": {
"gender": "MALE",
"location": {
"latitude": 0.000000,
"longitude": 0.000000
},
"timestamp": "2025-01-01 00:00:00",
"app_version": "0.0.1 (000)",
"device_ipv4": "0.0.0.0",
"device_ipv6": "::1",
"device_type": "iPhone",
"system_name": "iOS",
"system_version": "0.0",
"device_identifier": "Dummy Device"
},
"artifacts": {
"nfc_face_image": "https://dummy.domain.com/nfc_face_image.jpg",
"ocr_face_image": "https://dummy.domain.com/ocr_face_image.jpg",
"back_side_image": "https://dummy.domain.com/back_side_image.jpg",
"front_side_image": "https://dummy.domain.com/front_side_image.jpg",
"active_liveness_image": "https://dummy.domain.com/active_liveness_image.jpg"
},
"annotations": {
"face_matching": {
"mode": "both",
"notes": "",
"is_successful": true
}
},
"type": {
"value": 1,
"title": "oman ID"
},
"status": {
"value": 3,
"title": "Verified"
},
"status_notes": [],
"nfc_collected": true,
"processing_time": "1.234 seconds"
},
"message": "verification retrieved successfully.",
"consolidated_message": "verification retrieved successfully.",
"details": {}
}
- Example Passport Response:
{
"data": {
"id": "dummy-id-12345",
"created_at": "2025-08-03T12:19:20.546556+00:00",
"updated_at": "2025-08-03T12:19:25.292090+00:00",
"updated_by": null,
"data": {
"NFC": {
"name": "JOHN DOE",
"gender": "Male",
"address": "123 DUMMY STREET, TEST CITY",
"telephone": "9999999999",
"issue_date": "2022-01-01",
"nationality": "DUM",
"date_of_birth": "1990-01-01",
"document_type": "Passport",
"place_of_birth": "TEST CITY",
"issuing_country": "Dummyland",
"passport_number": "DUM1234567",
"personal_number": "123456789",
"issuing_authority": "TEST OFFICE",
"passport_expiry_date": "2032-01-01"
},
"scan": {
"gender": "MALE",
"country": "DUM",
"mrz_text": "P<DUMDOE<<JOHN<<<<<<<<<<<<<<<<<<<DUM1234567DUM9001019M3201011123456789<<<<<<<<<00",
"full_name": "DOE JOHN",
"document_no": "DUM1234567",
"expiry_date": "2032-01-01",
"nationality": "DUM",
"date_of_birth": "1990-01-01",
"document_type": "Passport"
},
"liveness": {
"active_liveness_confirmed": true,
"passive_liveness_confirmed": false
}
},
"metadata": {
"gender": "MALE",
"location": {
"latitude": 0.000000,
"longitude": 0.000000
},
"timestamp": "2025-08-03 12:19:19",
"app_version": "0.0.0 (000)",
"device_ipv4": "0.0.0.0",
"device_ipv6": "::1",
"device_type": "iPhone",
"system_name": "iOS",
"system_version": "0.0",
"device_identifier": "Dummy Device"
},
"artifacts": {
"nfc_face_image": "https://dummy.image.url/nfc_face.jpg",
"ocr_face_image": "https://dummy.image.url/ocr_face.jpg",
"front_side_image": "https://dummy.image.url/front_side.jpg",
"active_liveness_image": "https://dummy.image.url/active_liveness.jpg"
},
"annotations": {
"face_matching": {
"mode": "both",
"notes": "",
"is_successful": true
}
},
"type": {
"value": 2,
"title": "International Passport"
},
"status": {
"value": 3,
"title": "Verified"
},
"status_notes": [],
"nfc_collected": true,
"processing_time": 4.745
},
"message": "Verification retrieved successfully.",
"consolidated_message": "Verification retrieved successfully.",
"details": {}
}
The status
field represents the current state of the verification.
"status": { "value": <integer>, "title": <string> }
Possible status
values:
value | title | Description |
1 | Data not collected | One or more verification steps based on the functionality configured, did not complete successfully within allowed attempts or retries. |
2 | Data collected | All of the functionality configured in the verification steps were completed successfully, but the final evaluation against the selected verification criteria is still pending. |
3 | Verified | All verification criteria (default or custom verification rules) were successfully met. These may include checks such as data collection, face match, or liveness —depending on setup. |
4 | Not verified | One or more verification criteria (from default or custom verification rules) were not met. These may include checks such as data collection, face match, or liveness —depending on setup. |
5 | Processing | Initial verification data has been successfully collected, and the backend is still processing the results |
Last updated on August 8, 2025