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:

  1. 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
    
  2. After doing above step, you should navigate to Pods folder inside your project's file structure hierarchy. You should see the below one:

    Pods folder hierarchy

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:

  • The theme parameter has its type changed from IDWiseSDKTheme to IDWiseTheme
    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:

  • This method now takes a new optional parameter named applicantDetails which is a String:String dictionary. You can pass this parameter as nil if you do not intend to use it. For further information, please check documentation.
  • The parameter journeyDefinitionId is now renamed to flowId
  • The parameter journeyDelegate is now renamed to journeyCallbacks

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:

  • The parameter journeyDefinitionId parameter is now renamed to flowId
  • The parameter journeyDelegate is now renamed to journeyCallbacks

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 to IDWiseJourneyCallbacks

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 become journeyStartedInfo: IDWiseSDK.JourneyStartedInfo. The new type JourneyStartedInfo 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

  • This delegate method previously took one parameter journeyID but now the parameter changed to become journeyResumedInfo: JourneyResumedInfo. The new type JourneyResumedInfo 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

  • This delegate method is now named onJourneyCompleted
  • This delegate method previously took one parameter journeyID: String but now the parameter changed to become journeyCompletedInfo: JourneyCompletedInfo. The new type JourneyCompletedInfo 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

  • This delegate method is now named to onJourneyCancelled
  • This delegate method previously took one parameter journeyID: String but now the parameter changed to become journeyCancelledInfo: JourneyCancelledInfo. The new type JourneyCancelledInfo 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

  • This delegate method previously took one parameter of type IDWiseSDKError. But the type of this parameter was changed to become IDWiseError

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:

  • The theme parameter has its type changed from IDWiseSDKTheme to IDWiseTheme
  • IDWiseDynamic should be used instead of IDWise 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:

  • IDWiseDynamic should be used instead of IDWise to call this method.
  • This method is renamed from startDynamicJourney to startJourney.
  • This method now takes a new optional parameter named applicantDetails which is a String:String dictionary. You can pass this parameter as nil if you do not intend to use it. For further information, please check documentation.
  • The parameter journeyDefinitionId is now renamed to flowId
  • The parameter journeyDelegate is now renamed to journeyCallbacks

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:

  • IDWiseDynamic should be used instead of IDWise to call this method.
  • This method is renamed from resumeDynamicJourney to resumeJourney.
  • The parameter journeyDefinitionId parameter is now renamed to flowId
  • The parameter journeyDelegate is now renamed to journeyCallbacks

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:

  • IDWiseDynamic should be used instead of IDWise to call this method.
  • This method is renamed from finishDynamicJourney to finishJourney.

The following code:

IDWise.finishDynamicJourney()

Should be changed to become:

IDWiseDynamic.finishJourney()

IDWise.startStep method:

  • IDWiseDynamic should be used instead of IDWise 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:

  • IDWiseDynamic should be used instead of IDWise 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:

  • IDWiseDynamic should be used instead of IDWise 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:

  • IDWiseDynamic should be used instead of IDWise to call this method.

The following code:

IDWise.unloadSDK()

Should be changed to become:

IDWiseDynamic.unloadSDK()

IDWise.getJourneySummary method:

  • IDWiseDynamic should be used instead of IDWise 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 to IDWiseJourneyCallbacks

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 become journeyStartedInfo: IDWiseSDK.JourneyStartedInfo. The new type JourneyStartedInfo contains journeyId 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

  • This delegate method previously took one parameter journeyID but now the parameter changed to become journeyResumedInfo: JourneyResumedInfo. The new type JourneyResumedInfo contains journeyId 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

  • This delegate method is now named onJourneyCompleted
  • This delegate method previously took one parameter journeyID: String but now the parameter changed to become journeyCompletedInfo: JourneyCompletedInfo. The new type JourneyCompletedInfo contains journeyId 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

  • This delegate method is now named to onJourneyCancelled
  • This delegate method previously took one parameter journeyID: String but now the parameter changed to become journeyCancelledInfo: JourneyCancelledInfo. The new type JourneyCancelledInfo contains journeyIdas 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

  • This delegate method previously took one parameter of type IDWiseSDKError. But the type of this parameter was changed to become IDWiseError

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 to IDWiseStepCallbacks.

onStepCaptured Delegate Method

  • This delegate method previously took two parameters stepId: Int and capturedImage: UIImage? but now the parameter changed to become stepCapturedInfo: StepCapturedInfo. The new type StepCapturedInfo contains stepId: String, originalImage: UIImage? and croppedImage: 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

  • This delegate method previously took two parameters stepId: Int and stepResult: StepResult? but now the parameter changed to become stepResultInfo: IDWiseSDK.StepResultInfo. The new type StepResultInfo contains stepId: String and stepResult: 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

  • This delegate method previously took one parameter stepId: String but now the parameter changed to become stepCancelledInfo: StepCancelledInfo. The new type StepCancelledInfo contains stepId: 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

  • This delegate method previously took one parameter stepId: String but now the parameter changed to become stepSkippedInfo: StepSkippedInfo. The new type StepSkippedInfo contains stepId: 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)")
}