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.

1

Install

Add VRTX.framework or VRTX.xcframework to your iOS project and embed it in the host target.

2

Configure

Call Vrtx.setup with environment, credentials, theme mode, language, and optional font family.

3

Prepare Host App

Add required Info.plist keys and capabilities for Nafath, Face ID, and NFC where applicable.

4

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

RequirementValueNotes
Minimum iOS versioniOS 15.6Set the host app deployment target to iOS 15.6 or newer
LanguageSwift 5Required for host integration examples
UI frameworkUIKitPresent 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.

  1. Add the framework to your project.
  2. In your app target, add it under Frameworks, Libraries, and Embedded Content.
  3. Set the framework to Embed & Sign.
  4. 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.

  1. Drag VRTX/VRTX.xcodeproj into your host app project.
  2. Add VRTX.framework to your host target’s Frameworks, Libraries, and Embedded Content.
  3. Ensure Embed & Sign is enabled.
  4. Import the SDK in your host code: import VRTX

Quick Start

Call Vrtx.setup from the host app after you have the required credentials.

swift
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

ParameterEnumValues
environmentEnvironment.sandbox, .staging
languageLanguage.english, .arabic
modeMode.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:

xml
<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:

xml
<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.

  1. In the host app target, go to Signing & Capabilities.
  2. Enable Near Field Communication Tag Reading.
  3. Add the NFC usage description to Info.plist:
xml
<key>NFCReaderUsageDescription</key>
<string>Scan your card securely to activate it</string>
  1. Add ISO7816 select identifiers to the host app entitlements if the physical card flow requires ISO7816 tags:
xml
<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.

CallbackSignatureWhen it is calledRecommended host app behavior
onSuccess() -> VoidSDK setup succeeds and the SDK UI is launchedContinue the host app journey or wait for the SDK flow to complete
onError(VrtxError) -> VoidSDK setup or launch failsShow a host-app error screen or retry option
Required SDK callbacks
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.

FieldDescription
clientIDIdentifies the calling application
clientSecretAuthenticates 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:

xml
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>nafath</string>
</array>

Face ID configuration error is shown

Add NSFaceIDUsageDescription to the host app Info.plist.

xml
<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.
  • NFCReaderUsageDescription exists in Info.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.setup is called with valid clientID and clientSecret.
  • The selected environment is correct.
  • The host app handles onError and displays the returned error message where appropriate.
  • Required host app configuration is present for the enabled flows.