iOS SDK
Initialize, configure, and launch the Vrtx iOS SDK inside your host application. This guide covers supported iOS versions, installation, setup, host app configuration, callbacks, authentication, session behavior, and troubleshooting.
What this guide covers
Use this page when integrating the Vrtx SDK into an iOS host app. The SDK provides native wallet, onboarding, login, Nafath, OTP, and card-related flows through a UIKit-based experience.
Install
Add VRTX.framework or VRTX.xcframework to your iOS project and embed it in the host target.
Configure
Call Vrtx.setup with environment, credentials, theme mode, language, and optional font family.
Prepare Host App
Add required Info.plist keys and capabilities for Nafath, Face ID, and NFC where applicable.
Launch
Present the SDK flow and handle success or error callbacks from the host app.
Overview
The Vrtx SDK provides a native iOS wallet and onboarding experience that can be presented from your host application. Supported flows may include KYC, OTP verification, Nafath authentication, wallet login, and card flows.
The SDK is UIKit-based and presents its own UINavigationController flow from a host UIViewController.
Supported iOS Versions & Requirements
| Requirement | Value | Notes |
|---|---|---|
| Minimum iOS version | iOS 15.6 | Set the host app deployment target to iOS 15.6 or newer |
| Language | Swift 5 | Required for host integration examples |
| UI framework | UIKit | Present the SDK from a host UIViewController |
Installation
The SDK is delivered as VRTX.framework or VRTX.xcframework. You can either embed the framework directly or add the SDK project as a subproject.
Option A — Embed Framework
Embed VRTX.framework / VRTX.xcframework
Use this option if you already have the SDK framework package.
- Add the framework to your project.
- In your app target, add it under Frameworks, Libraries, and Embedded Content.
- Set the framework to Embed & Sign.
- Import the SDK in your host code:
import VRTX
Option B — Add Subproject
Add VRTX.xcodeproj as a subproject
Use this option if you are integrating the SDK as an Xcode project.
- Drag
VRTX/VRTX.xcodeprojinto your host app project. - Add
VRTX.frameworkto your host target’s Frameworks, Libraries, and Embedded Content. - Ensure Embed & Sign is enabled.
- Import the SDK in your host code:
import VRTX
Quick Start
Call Vrtx.setup from the host app after you have the required credentials.
import VRTX
Vrtx.setup(
environment: .sandbox,
clientID: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
mode: .light,
language: .english,
fontFamily: "Inter", // Optional. Omit to use the SDK default font per language.
onSuccess: {
// SDK UI launched successfully.
},
onError: { error in
// Handle setup or launch failure.
// Example: error.status, error.message
}
)Security note
Never hard-code clientSecret or production credentials in source control. Store credentials securely and follow your internal secret management process.
Contract
| Parameter | Enum | Values |
|---|---|---|
| environment | Environment | .sandbox, .staging |
| language | Language | .english, .arabic |
| mode | Mode | .light, .dark |
Custom font
To use a custom font such as Inter, the font must already be embedded and registered in the host application. If fontFamily is omitted, the SDK uses its default font for the selected language.
Required Host App Configuration
The SDK may use Nafath deep-linking, biometrics, and NFC depending on the enabled flows. Configure the required host app settings before launching the SDK.
Nafath URL Scheme
Nafath deep-linking requires the nafath:// URL scheme to be whitelisted in the host app.
Add the following to Info.plist:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>nafath</string>
</array>Required for Nafath
If nafath is not included in LSApplicationQueriesSchemes, the SDK may not be able to check or open the Nafath app.
Face ID Usage Description
If biometrics are enabled in the SDK, add the Face ID usage description to Info.plist:
<key>NSFaceIDUsageDescription</key>
<string>Use Face ID to quickly and securely access VRTX Pay</string>If this key is missing, the SDK will display a configuration error when the biometric enable step is reached.
NFC Capability
NFC configuration is required only for physical card flows that use Core NFC.
- In the host app target, go to Signing & Capabilities.
- Enable Near Field Communication Tag Reading.
- Add the NFC usage description to
Info.plist:
<key>NFCReaderUsageDescription</key>
<string>Scan your card securely to activate it</string>- Add ISO7816 select identifiers to the host app entitlements if the physical card flow requires ISO7816 tags:
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>325041592E5359532E4444463031</string>
<string>A0000000031010</string>
<string>A0000000032010</string>
<string>A0000000032020</string>
<string>A0000000980840</string>
<string>A0000000041010</string>
</array>NFC entitlement validation
Apple validates NFC entitlements at runtime. Missing capabilities, usage descriptions, or required AIDs can prevent NFC scanning from starting.
SDK Callbacks & Lifecycle
The SDK exposes callbacks through Vrtx.setup.
| Callback | Signature | When it is called | Recommended host app behavior |
|---|---|---|---|
onSuccess | () -> Void | SDK setup succeeds and the SDK UI is launched | Continue the host app journey or wait for the SDK flow to complete |
onError | (VrtxError) -> Void | SDK setup or launch fails | Show a host-app error screen or retry option |
Best practice
Keep SDK error handling in the host app consistent with your existing app error patterns. Do not leave users blocked if the SDK cannot be launched.
Authentication
The SDK authenticates with the Vrtx backend using a client credentials flow.
| Field | Description |
|---|---|
clientID | Identifies the calling application |
clientSecret | Authenticates the calling application |
The SDK requests /auth/token and injects the returned bearer token into subsequent API requests.
Credential handling
Treat clientSecret as sensitive. Do not expose it in public repositories, client logs, screenshots, analytics events, or crash reports.
Integration Checklist
iOS SDK integration checklist
Troubleshooting
Nafath app does not open
Check that LSApplicationQueriesSchemes includes nafath:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>nafath</string>
</array>Face ID configuration error is shown
Add NSFaceIDUsageDescription to the host app Info.plist.
<key>NSFaceIDUsageDescription</key>
<string>Use Face ID to quickly and securely access VRTX Pay</string>NFC scanning does not start or fails immediately
Confirm the following:
- NFC capability is enabled for the host target.
NFCReaderUsageDescriptionexists inInfo.plist.- Required AIDs are present in the host app entitlements under
iso7816.select-identifiers. - The physical card flow is enabled only where NFC is required.
SDK does not launch
Confirm the following:
Vrtx.setupis called with validclientIDandclientSecret.- The selected
environmentis correct. - The host app handles
onErrorand displays the returned error message where appropriate. - Required host app configuration is present for the enabled flows.