ZOLOZ iOS SDK Integration via Swift Package

This document provides a comprehensive walkthrough of the complete workflow for integrating the ZOLOZ iOS SDK via Swift Package.

Overview

The Swift Package SDK and the CocoaPods SDK share identical core functionalities, with only slight differences in integration approach and dependency management.

The Swift Package SDK utilizes the XCFramework format and supports compilation and execution on Apple silicon simulators.

Prerequisites

Before integrating the ZOLOZ iOS SDK, ensure that your Xcode version is 15.0 or later.

Procedures

Step 1: Add the package dependency

  1. In Xcode, select File > Add Package Dependencies....
    image
  2. Enter the repository address in the search box located at the upper right corner of the popup window. The address is https://github.com/zoloz-pte-ltd/zoloz-demo-ios.

image.png

  1. In Dependency Rule section, select Branch, enter the branch name master, and then click Add Package.
    image.png
  2. Select the required Package Products, and click Add Package after configuration is complete.
    • For non-customized SDK customers, set ZolozKitWithoutWebContainer to None.
      image
    • If you do not need NFC functionality, set ZolozKitNfcReader to None.
      image

Step 2: Verify the SDK integration result

After successful integration, zolozkit will appear in your project's Package Dependencies.

image

Validation of Integration

After integration is complete, use the following two tests to verify whether the SDK is successfully integrated.

Verify metainfo Retrieval

Run the following codes in the project to retrieve metainfo. If metaInfo content is successfully displayed, the SDK integration is successful.

copy
let metainfo = ZLZFacade.getMetaInfo();
showAlert(title: "METAINFO", message: metainfo)

Below is a complete metainfo example.

copy
{
    "appVersion": "1", 
    "bioMetaInfo": "3.46.0:0,2;RJBBACRJIIFQGQDARIJ4BNJACJA=;2.0.8.251111182808", 
    "appName": "zoloz.demo.spmdemo.mj.SPMDemo", 
    "deviceType": "ios", 
    "osVersion": "iOS 26.1", 
    "keyHash": "5EBC**", 
    "buildVersion": "2.0.8.251111182808", 
    "apdidToken": "ZLZ0307B71E92194BCD843170C4F417****", 
    "deviceModel": "iPhone13,3"
}

Verify resource files Import

Run the following codes to verify whether the required resource files for ZOLOZ are successfully imported.

copy
let url = Bundle.main.url(forResource: "zolozkit_resources", withExtension: "bundle")
if let bundleURL = url, let bundle = Bundle(url: bundleURL) {
    let files = try! FileManager.default.contentsOfDirectory(atPath: bundle.resourcePath!)
    let msg = files.joined(separator: ", ")
    print(msg)
    let alert = UIAlertController(title: "Zoloz Bundles", message: msg, preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "OK", style: .default))
    self.present(alert, animated: true)
} else {
    let alert = UIAlertController(title: "Error", message: "zolozkit_resources.bundle not found", preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "CLOSE", style: .default))
    self.present(alert, animated: true)
}

If the following files is successfully displayed, the SDK integration is successful.

copy
WebContainerLite.bundle, ZolozNfcReader.bundle, ToygerService.bundle, Info.plist, BioAuthEngine.bundle, ZolozKit.bundle