iOS SDK Migration Guide
We strongly recommend using the latest version of IDWise SDK. This ensures you always have access to the latest improvements, bug fixes, and security updates.
Migrating from v4.x.x to v5.x.x
This guide will help you to migrate from version 4.x.x to version 5.x.x of IDWise SDK.
Installing the New Version
Please follow these steps to migrate to the latest version of the SDK:
-
Open Terminal and navigate to your project directory inside the terminal. Run the following commands one by one:
rm Podfile.lock pod deintegrate pod cache clean --all pod update -
After doing above step, you should navigate to
Podsfolder inside your project's file structure hierarchy. You should see the below one:
Simple SDK Code Changes
If you are using Simple SDK integration please follow the following sections to change your code to be compatible with the new version:
IDWise.initialize method:
IDWise.initialize method:- The
themeparameter has its type changed fromIDWiseSDKThemetoIDWiseTheme
The following code:
IDWise.initialize(clientKey: "CLIENT_KEY", theme: IDWiseSDKTheme.systemDefault) { err in }Should be changed to be like this:
IDWise.initialize(clientKey: "CLIENT_KEY", theme:IDWiseTheme.systemDefault) { err in }IDWise.startJourney method:
IDWise.startJourney method:- This method now takes a new optional parameter named
applicantDetailswhich is aString:Stringdictionary. You can pass this parameter asnilif you do not intend to use it. For further information, please check documentation. - The parameter
journeyDefinitionIdis now renamed toflowId - The parameter
journeyDelegateis now renamed tojourneyCallbacks
The following code:
IDWise.startJourney(journeyDefinitionId: "FLOW_ID", referenceNumber: "REFERENCE_NUMBER",locale: "LOCALE", journeyDelegate: self)Should be changed to become:
IDWise.startJourney(flowId:"FLOW_ID", referenceNumber: "REFERENCE_NUMBER", locale: "LOCALE", applicantDetails: nil, journeyCallbacks: self)IDWise.resumeJourney method:
IDWise.resumeJourney method:- The parameter
journeyDefinitionIdparameter is now renamed toflowId - The parameter
journeyDelegateis now renamed tojourneyCallbacks
The following code:
IDWise.resumeJourney(journeyDefinitionId: "FLOW_ID", journeyId:"YOUR_JOURNEY_ID", journeyDelegate: self)Should be changed to become:
IDWise.resumeJourney(flowId: "FLOW_ID", journeyId: "YOUR_JOURNEY_ID", journeyCallbacks: self)IDWiseSDK Journey Delegate Methods
- The delegate type
IDWiseSDKJourneyDelegateis now named toIDWiseJourneyCallbacks
JourneyStarted Delegate Method
JourneyStarted Delegate Method- This delegate method is now named
onJourneyStarted - This delegate method previously took one parameter
journeyID: Stringbut now the parameter changed to becomejourneyStartedInfo: IDWiseSDK.JourneyStartedInfo. The new typeJourneyStartedInfocontains Journey Id as a sub field.
The following code:
func JourneyStarted(journeyID: String) {
print("New Journey Started with id: \(journeyID)")
}Should be changed to become:
func onJourneyStarted(journeyStartedInfo: JourneyStartedInfo) {
print("New Journey Started with id: \(journeyStartedInfo.journeyId)")
}onJourneyResumed Delegate Method
onJourneyResumed Delegate Method- This delegate method previously took one parameter
journeyIDbut now the parameter changed to becomejourneyResumedInfo: JourneyResumedInfo. The new typeJourneyResumedInfocontains Journey Id as a sub field.
The following code:
func onJourneyResumed(journeyID: String) {
print("Journey with id \(journeyID) was resumed")
}Should be changed to become:
func onJourneyResumed(journeyResumedInfo: IDWiseSDK.JourneyResumedInfo) {
print("Journey with id \(journeyResumedInfo.journeyId) was resumed")
}JourneyFinished Delegate Method
JourneyFinished Delegate Method- This delegate method is now named
onJourneyCompleted - This delegate method previously took one parameter
journeyID: Stringbut now the parameter changed to becomejourneyCompletedInfo: JourneyCompletedInfo. The new typeJourneyCompletedInfocontains Journey Id as a sub field.
The following code:
func JourneyFinished(journeyID: String) {
print("Journey with ID: \(journeyID) was completed")
}Should be changed to become:
func onJourneyCompleted(journeyCompletedInfo: IDWiseSDK.JourneyCompletedInfo) {
print("Journey with id: \(journeyCompletedInfo.journeyId) was completed")
}JourneyCancelled Delegate Method
JourneyCancelled Delegate Method- This delegate method is now named to
onJourneyCancelled - This delegate method previously took one parameter
journeyID: Stringbut now the parameter changed to becomejourneyCancelledInfo: JourneyCancelledInfo. The new typeJourneyCancelledInfocontains Journey Id as a sub field.
The following code:
func JourneyCancelled() {
print("Journey cancelled")
}Should be changed to become:
func onJourneyCancelled(journeyCancelledInfo: IDWiseSDK.JourneyCancelledInfo) {
print("Journey with id: \(journeyCancelledInfo.journeyId) was cancelled")
}onError Delegate Method
onError Delegate Method- This delegate method previously took one parameter of type
IDWiseSDKError. But the type of this parameter was changed to becomeIDWiseError
The following code:
func onError(error : IDWiseSDKError) {
print("An error has occurred with these details. Error code: \(error.code) Error message: \(error.message)")
}Should be changed to become:
func onError(error: IDWiseError) {
print("An error has occurred with these details. Error code: \(error.code) Error message: \(error.message.)")
}Dynamic SDK Migration
If you are using Dynamic SDK integration please follow the following sections to change your code to be compatible with the new version.
You should use IDWiseDynamic object to call methods in dynamic mode.
IDWise.initialize method:
IDWise.initialize method:- The
themeparameter has its type changed fromIDWiseSDKThemetoIDWiseTheme IDWiseDynamicshould be used instead ofIDWiseto call this method.
The following code:
IDWise.initialize(clientKey: "CLIENT_KEY", theme: IDWiseSDKTheme.systemDefault) { err in }Should be changed to be like this:
IDWiseDynamic.initialize(clientKey: "CLIENT_KEY", theme:IDWiseTheme.systemDefault) { err in }IDWise.startDynamicJourney method:
IDWise.startDynamicJourney method:IDWiseDynamicshould be used instead ofIDWiseto call this method.- This method is renamed from
startDynamicJourneytostartJourney. - This method now takes a new optional parameter named
applicantDetailswhich is aString:Stringdictionary. You can pass this parameter asnilif you do not intend to use it. For further information, please check documentation. - The parameter
journeyDefinitionIdis now renamed toflowId - The parameter
journeyDelegateis now renamed tojourneyCallbacks
The following code:
IDWise.startDynamicJourney(journeyDefinitionId: "FLOW_ID", referenceNumber: "REFERENCE_NUMBER",locale: "LOCALE", journeyDelegate: self)Should be changed to become:
IDWiseDynamic.startJourney(flowId:"FLOW_ID", referenceNumber: "REFERENCE_NUMBER", locale: "LOCALE", applicantDetails: nil, journeyCallbacks: self)IDWise.resumeDynamicJourney method:
IDWise.resumeDynamicJourney method:IDWiseDynamicshould be used instead ofIDWiseto call this method.- This method is renamed from
resumeDynamicJourneytoresumeJourney. - The parameter
journeyDefinitionIdparameter is now renamed toflowId - The parameter
journeyDelegateis now renamed tojourneyCallbacks
The following code:
IDWise.resumeDynamicJourney(journeyDefinitionId: "FLOW_ID", journeyId:"YOUR_JOURNEY_ID", journeyDelegate: self)Should be changed to become:
IDWiseDynamic.resumeJourney(flowId: "FLOW_ID", journeyId: "YOUR_JOURNEY_ID", journeyCallbacks: self)IDWise.finishDynamicJourney method:
IDWise.finishDynamicJourney method:IDWiseDynamicshould be used instead ofIDWiseto call this method.- This method is renamed from
finishDynamicJourneytofinishJourney.
The following code:
IDWise.finishDynamicJourney()Should be changed to become:
IDWiseDynamic.finishJourney()IDWise.startStep method:
IDWise.startStep method:IDWiseDynamicshould be used instead ofIDWiseto call this method.
The following code:
IDWise.startStep(stepId: "STEP_ID")Should be changed to become:
IDWiseDynamic.startStep(stepId: "STEP_ID")IDWise.startStepFromFileUpload method:
IDWise.startStepFromFileUpload method:IDWiseDynamicshould be used instead ofIDWiseto call this method.
The following code:
IDWise.startStepFromFileUpload(stepId: "STEP_ID" , data: "IMAGE_DATA" )Should be changed to become:
IDWiseDynamic.startStepFromFileUpload(stepId: "STEP_ID" , data: "IMAGE_DATA" )IDWise.skipStep method:
IDWise.skipStep method:IDWiseDynamicshould be used instead ofIDWiseto call this method.
The following code:
IDWise.skipStep(stepId: "STEP_ID")Should be changed to become:
IDWiseDynamic.skipStep(stepId: "STEP_ID")IDWise.unloadSDK method:
IDWise.unloadSDK method:IDWiseDynamicshould be used instead ofIDWiseto call this method.
The following code:
IDWise.unloadSDK()Should be changed to become:
IDWiseDynamic.unloadSDK()IDWise.getJourneySummary method:
IDWise.getJourneySummary method:IDWiseDynamicshould be used instead ofIDWiseto call this method.
The following code:
IDWise.getJourneySummary { summary, error in }Should be changed to become:
IDWiseDynamic.getJourneySummary { summary, error in }IDWiseSDK Journey Delegate Methods
- The delegate type
IDWiseSDKJourneyDelegateis now named toIDWiseJourneyCallbacks
JourneyStarted Delegate Method
JourneyStarted Delegate Method- This delegate method is now named
onJourneyStarted - This delegate method previously took one parameter
journeyID: Stringbut now the parameter changed to becomejourneyStartedInfo: IDWiseSDK.JourneyStartedInfo. The new typeJourneyStartedInfocontainsjourneyIdas a sub field.
The following code:
func JourneyStarted(journeyID: String) {
print("New Journey Started with id: \(journeyID)")
}Should be changed to become:
func onJourneyStarted(journeyStartedInfo: JourneyStartedInfo) {
print("New Journey Started with id: \(journeyStartedInfo.journeyId)")
}onJourneyResumed Delegate Method
onJourneyResumed Delegate Method- This delegate method previously took one parameter
journeyIDbut now the parameter changed to becomejourneyResumedInfo: JourneyResumedInfo. The new typeJourneyResumedInfocontainsjourneyIdas a sub field.
The following code:
func onJourneyResumed(journeyID: String) {
print("Journey with id \(journeyID) was resumed")
}Should be changed to become:
func onJourneyResumed(journeyResumedInfo: IDWiseSDK.JourneyResumedInfo) {
print("Journey with id \(journeyResumedInfo.journeyId) was resumed")
}JourneyFinished Delegate Method
JourneyFinished Delegate Method- This delegate method is now named
onJourneyCompleted - This delegate method previously took one parameter
journeyID: Stringbut now the parameter changed to becomejourneyCompletedInfo: JourneyCompletedInfo. The new typeJourneyCompletedInfocontainsjourneyIdas a sub field.
The following code:
func JourneyFinished(journeyID: String) {
print("Journey with ID: \(journeyID) was completed")
}Should be changed to become:
func onJourneyCompleted(journeyCompletedInfo: IDWiseSDK.JourneyCompletedInfo) {
print("Journey with id: \(journeyCompletedInfo.journeyId) was completed")
}JourneyCancelled Delegate Method
JourneyCancelled Delegate Method- This delegate method is now named to
onJourneyCancelled - This delegate method previously took one parameter
journeyID: Stringbut now the parameter changed to becomejourneyCancelledInfo: JourneyCancelledInfo. The new typeJourneyCancelledInfocontainsjourneyIdas a sub field.
The following code:
func JourneyCancelled() {
print("Journey cancelled")
}Should be changed to become:
func onJourneyCancelled(journeyCancelledInfo: IDWiseSDK.JourneyCancelledInfo) {
print("Journey with id: \(journeyCancelledInfo.journeyId) was cancelled")
}onError Delegate Method
onError Delegate Method- This delegate method previously took one parameter of type
IDWiseSDKError. But the type of this parameter was changed to becomeIDWiseError
The following code:
func onError(error : IDWiseSDKError) {
print("An error has occurred with these details. Error code: \(error.code) Error message: \(error.message)")
}Should be changed to become:
func onError(error: IDWiseError) {
print("An error has occurred with these details. Error code: \(error.code) Error message: \(error.message.)")
}IDWiseSDK Step Delegate Methods
- The delegate type
IDWiseSDKStepDelegateis now renamed toIDWiseStepCallbacks.
onStepCaptured Delegate Method
onStepCaptured Delegate Method- This delegate method previously took two parameters
stepId: IntandcapturedImage: UIImage?but now the parameter changed to becomestepCapturedInfo: StepCapturedInfo. The new typeStepCapturedInfocontainsstepId: String,originalImage: UIImage?andcroppedImage: UIImage?as a subfields.
The following code:
func onStepCaptured(stepId: Int, capturedImage: UIImage?) {
}Should be changed to become:
func onStepCaptured(stepCapturedInfo: StepCapturedInfo) {
print("STEP CAPTURED with stepId :: \(stepCapturedInfo.stepId)")
}onStepResult Delegate Method
onStepResult Delegate Method- This delegate method previously took two parameters
stepId: IntandstepResult: StepResult?but now the parameter changed to becomestepResultInfo: IDWiseSDK.StepResultInfo. The new typeStepResultInfocontainsstepId: StringandstepResult: StepResult?as subfields.
The following code:
func onStepResult(stepId: Int,stepResult: StepResult?) {
}Should be changed to become:
func onStepResult(stepResultInfo: StepResultInfo) {
print("STEP RESULT with stepId :: \(stepResultInfo.stepId)")
print("STEP RESULT :: \(stepResultInfo.stepResult)")
}onStepCancelled Delegate Method
onStepCancelled Delegate Method- This delegate method previously took one parameter
stepId: Stringbut now the parameter changed to becomestepCancelledInfo: StepCancelledInfo. The new typeStepCancelledInfocontainsstepId: Stringas a sub field.
The following code:
func onStepCancelled(stepId: String) {
}Should be changed to become:
func onStepCancelled(stepCancelledInfo: StepCancelledInfo) {
print("Step cancelled : \(stepCancelledInfo.stepId)")
}onStepSkipped Delegate Method
onStepSkipped Delegate Method-
This delegate method previously took one parameter
stepId: Stringbut now the parameter changed to becomestepSkippedInfo: StepSkippedInfo. The new typeStepSkippedInfocontainsstepId: Stringas a sub field.The following code:
func onStepSkipped(stepId: String) {
}Should be changed to become:
func onStepSkipped(stepSkippedInfo: StepSkippedInfo) {
print("Step skipped : \(stepSkippedInfo.stepId)")
}Updated about 1 month ago
