iOS SDK Integration
Introduction
This document serves as a comprehensive guide for iOS 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
iOS:
- iOS 16.0 or higher
- Xcode 16.1 or higher
Installation
iOS:
- Add the following CocoaPod to your Podfile:
pod 'nashidVerifySDK'
// Add this script at the end of the file
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
# Exclude arm64 for iPhone simulator builds
installer.pods_project.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
end
- Enable Near Field Communication (NFC) Reading capability in your projects, as follows:
- Open your project in Xcode.
- Navigate to your Target settings.
- Go to the Signing & Capabilities tab.
- Click the + Capability button.
- Select Near Field Communication Tag Reading from the list.
- Set Privacy Usage Description for NFC, as follows:
- In Xcode, go to the Build Settings tab.
- Search for Privacy - NFC Scan Usage Description.
- Double-click the field and add desired description, for example: "Needed permission to read Passport’s NFC"
- Add the following script in Build Phases > Run Script (see note 1):
FRAMEWORK_PATH="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NewVerifySDK.framework"
if [[ -d "${FRAMEWORK_PATH}/Frameworks" ]]; then
echo "Removing nested Frameworks directory from NewVerifySDK.framework"
rm -rf "${FRAMEWORK_PATH}/Frameworks"
else
echo "No nested Frameworks directory found in NewVerifySDK.framework"
fi
Note 1: This step only needed If you face an error disallowed nested bundles when you upload the build on the App store.
- Add the required permissions in your
Info.plist
file:
<key>NSCameraUsageDescription</key>
<string>Camera permission is required to complete the full KYC process.</string>
<key>NFCReaderUsageDescription</key>
<string>NFC permission is required to complete the full KYC process.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location permission is required to complete the full KYC process.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Location permission is required to complete the full KYC process.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Location permission is required to complete the full KYC process.</string>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A000000018524F500101</string>
<string>A0000002471001</string>
<string>A0000002472001</string>
<string>00000000000000</string>
<string>A00000024300130000000101</string>
<string>A0000002430013000000010109</string>
<string>A000000243001300000001FF</string>
</array>
Usage
1. Import Nashid Verify SDK:
import NewVerifySDK
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.
let isInitializeSDK = VerifySDKManager.shared.initialize(
sdkKey: "YOUR_SDK_KEY",
sdkSecretKey: "YOUR_SECRET_KEY",
languageId: "en",
extraData: [ // optional
"example-key ": "example-values",
]
)
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
let verifyResult = VerifySDKManager.shared.verify(ofType: .OMANI_ID)
Example 2: Verify With International Passport
let verifyResult = VerifySDKManager.shared.verify(ofType: .INTERNATIONAL_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
iOS:
let scanResults = VerifySDKManager.shared.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