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
Pods
folder 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
theme
parameter has its type changed fromIDWiseSDKTheme
toIDWiseTheme
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
applicantDetails
which is aString:String
dictionary. You can pass this parameter asnil
if you do not intend to use it. For further information, please check documentation. - The parameter
journeyDefinitionId
is now renamed toflowId
- The parameter
journeyDelegate
is 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
journeyDefinitionId
parameter is now renamed toflowId
- The parameter
journeyDelegate
is 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
IDWiseSDKJourneyDelegate
is now named toIDWiseJourneyCallbacks
JourneyStarted
Delegate Method
JourneyStarted
Delegate Method- This delegate method is now named
onJourneyStarted
- This delegate method previously took one parameter
journeyID: String
but now the parameter changed to becomejourneyStartedInfo: IDWiseSDK.JourneyStartedInfo
. The new typeJourneyStartedInfo
contains 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
journeyID
but now the parameter changed to becomejourneyResumedInfo: JourneyResumedInfo
. The new typeJourneyResumedInfo
contains 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: String
but now the parameter changed to becomejourneyCompletedInfo: JourneyCompletedInfo
. The new typeJourneyCompletedInfo
contains 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: String
but now the parameter changed to becomejourneyCancelledInfo: JourneyCancelledInfo
. The new typeJourneyCancelledInfo
contains 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
theme
parameter has its type changed fromIDWiseSDKTheme
toIDWiseTheme
IDWiseDynamic
should be used instead ofIDWise
to 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:IDWiseDynamic
should be used instead ofIDWise
to call this method.- This method is renamed from
startDynamicJourney
tostartJourney
. - This method now takes a new optional parameter named
applicantDetails
which is aString:String
dictionary. You can pass this parameter asnil
if you do not intend to use it. For further information, please check documentation. - The parameter
journeyDefinitionId
is now renamed toflowId
- The parameter
journeyDelegate
is 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:IDWiseDynamic
should be used instead ofIDWise
to call this method.- This method is renamed from
resumeDynamicJourney
toresumeJourney
. - The parameter
journeyDefinitionId
parameter is now renamed toflowId
- The parameter
journeyDelegate
is 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:IDWiseDynamic
should be used instead ofIDWise
to call this method.- This method is renamed from
finishDynamicJourney
tofinishJourney
.
The following code:
IDWise.finishDynamicJourney()
Should be changed to become:
IDWiseDynamic.finishJourney()
IDWise.startStep
method:
IDWise.startStep
method:IDWiseDynamic
should be used instead ofIDWise
to 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:IDWiseDynamic
should be used instead ofIDWise
to 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:IDWiseDynamic
should be used instead ofIDWise
to 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:IDWiseDynamic
should be used instead ofIDWise
to call this method.
The following code:
IDWise.unloadSDK()
Should be changed to become:
IDWiseDynamic.unloadSDK()
IDWise.getJourneySummary
method:
IDWise.getJourneySummary
method:IDWiseDynamic
should be used instead ofIDWise
to 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
IDWiseSDKJourneyDelegate
is now named toIDWiseJourneyCallbacks
JourneyStarted
Delegate Method
JourneyStarted
Delegate Method- This delegate method is now named
onJourneyStarted
- This delegate method previously took one parameter
journeyID: String
but now the parameter changed to becomejourneyStartedInfo: IDWiseSDK.JourneyStartedInfo
. The new typeJourneyStartedInfo
containsjourneyId
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
journeyID
but now the parameter changed to becomejourneyResumedInfo: JourneyResumedInfo
. The new typeJourneyResumedInfo
containsjourneyId
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: String
but now the parameter changed to becomejourneyCompletedInfo: JourneyCompletedInfo
. The new typeJourneyCompletedInfo
containsjourneyId
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: String
but now the parameter changed to becomejourneyCancelledInfo: JourneyCancelledInfo
. The new typeJourneyCancelledInfo
containsjourneyId
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.)")
}
IDWiseSDK Step Delegate Methods
- The delegate type
IDWiseSDKStepDelegate
is now renamed toIDWiseStepCallbacks
.
onStepCaptured
Delegate Method
onStepCaptured
Delegate Method- This delegate method previously took two parameters
stepId: Int
andcapturedImage: UIImage?
but now the parameter changed to becomestepCapturedInfo: StepCapturedInfo
. The new typeStepCapturedInfo
containsstepId: 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: Int
andstepResult: StepResult?
but now the parameter changed to becomestepResultInfo: IDWiseSDK.StepResultInfo
. The new typeStepResultInfo
containsstepId: String
andstepResult: 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: String
but now the parameter changed to becomestepCancelledInfo: StepCancelledInfo
. The new typeStepCancelledInfo
containsstepId: String
as 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: String
but now the parameter changed to becomestepSkippedInfo: StepSkippedInfo
. The new typeStepSkippedInfo
containsstepId: String
as 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