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:
-
Add
DigitalIdentity&Ojoframeworks to theFrameworks, Library and Embedded Contentsection in your Xcode project settings. Update the Embed value as per the attached screenshot
-
Add the
DigitalIdentityResources.bundlefile to theCopy bundle resourcesection of Build Phases.
-
Add the
SSZipArchiveSDK dependency via CocoaPods:pod 'SSZipArchive' -
Add the
ClickstreamSDK dependency via CocoaPods:pod 'Clickstream', '2.0.42' -
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 theinfo.plist` file. - LSApplicationQueriesSchemes: For security purposes, you need to add the following JB app-related schemes in the
LSApplicationQueriesSchemeskey:- 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 ofDigitalIdentityConfigurationclassenvironment:DigitalIdentityEnvironmentenum type. Pass eitherstagingorprodbased on the app environment.analyticsManager: A class reference that implements theIDigitalIdentityAnalyticsManagerdelegate method. This class is responsible for tracking events in the partner analytics platform.userProfile: Instance ofDigitalIdentityUserProfileclass.userId: Current User ID.
IDigitalIdentityAnalyticsManager
IDigitalIdentityAnalyticsManager delegate has the following methods:
trackEvent
trackEventtrackEvent(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()
Updated 5 months ago