Getting Started


DigitalIdentity iOS SDK

Requirements

  • Digital Identity SDK supports iOS version 12 & above
  • IDE: XCode 16

Installation

Manual

DigitalIdentity SDK requires the following SDKs for the supported features:

  • Ojo
  • SSZipArchive

Steps:

  1. Add DigitalIdentity & Ojo frameworks to the Frameworks, Library and Embedded Content section in your Xcode project settings. Update the Embed value as per the attached screenshot

  2. Add the DigitalIdentityResources.bundle file to the Copy bundle resource section of Build Phases.

  3. Add the SSZipArchive SDK dependency via CocoaPods:

    pod 'SSZipArchive'
    
  4. Add the Clickstream SDK dependency via CocoaPods:

    pod 'Clickstream', '2.0.42'
    
  5. Add the following post-install script in your Podfile to update build settings for the Clickstream framework:

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        # Set BUILD_LIBRARY_FOR_DISTRIBUTION to YES for specific targets
        if ["SwiftProtobuf", "ReachabilitySwift", "GRDB.swift", "Clickstream"].include?(target.name)
          target.build_configurations.each do |config|
            config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
          end
        end
      end
    end
    

Setup Digital Identity SDK

Changes in Plist file

  • NSCameraUsageDescription: To enable camera access, you need to add Privacy - Camera Usage Description (NSCameraUsageDescription) with a proper access description in the info.plist` file.
  • LSApplicationQueriesSchemes: For security purposes, you need to add the following JB app-related schemes in the LSApplicationQueriesSchemes key:
    • zbra
    • cydia
    • undecimus
    • sileo
    • filza

Initialise SDK

You need to initialize the Digital Identity SDK before accessing its functionality. The initialise method is asynchronous. Once you receive completion for the initialise method, you can trigger the respective Digital Identity SDK flows.

Usage:

let userProfile = DigitalIdentityUserProfile(userId: <User id>)

let configuration = DigitalIdentityConfiguration(
    environment: <App Environment>,
    analyticsManager: self,
    userProfile: userProfile
)

DigitalIdentitySdk.shared.initialise(configuration: configuration) {
    // Completion handler
}

Method name: initialise

Parameters:

  • configuration: Instance of DigitalIdentityConfiguration class
    • environment: DigitalIdentityEnvironment enum type. Pass either staging or prod based on the app environment.
    • analyticsManager: A class reference that implements the IDigitalIdentityAnalyticsManager delegate method. This class is responsible for tracking events in the partner analytics platform.
    • userProfile: Instance of DigitalIdentityUserProfile class.
      • userId: Current User ID.

IDigitalIdentityAnalyticsManager

IDigitalIdentityAnalyticsManager delegate has the following methods:

trackEvent

trackEvent(name: String, properties: [String: Any]?)

You need to implement this method to track Digital Identity SDK related events on the Partner app analytics portal. This method will be triggered whenever the Digital Identity SDK wants to track an event.


Clear SDK Instance

Method to remove the unused objects from memory. Call this method in the Partner app's Digital Identity SDK-related feature completion. Once we triggered this method, it’s mandatory to call the Initialise method before initiating any Sdk flows.

Method name: dispose

Method to remove the unused objects from memory. It's an optional method triggered from the Partner app side. Invoke this method upon completing the DigitalIdentity SDK–related feature in the Partner app to remove unused objects from memory. Once we trigger this method, it’s mandatory to call the Initialise method again before initiating any SDK flows.

Usage:

DigitalIdentitySdk.shared.dispose()

Clear SDK Cache Data

Method to clear the local cache data that was created by the DigitalIdentity sdk. Call this method in the Partner app when the user is doing logout.

Method name: clearCache

Usage:

DigitalIdentitySdk.shared.clearCache()

Documentations