Android SDK Migration Guide

📘

Info

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.

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("CLIENT_KEY", IDWiseSDKTheme.SYSTEM_DEFAULT) { error->
	//some error occured                                                                               
}

Should be changed to be like this:

val clientKey = "<YOUR_CLIENT_KEY>"
val theme = IDWiseTheme.SYSTEM_DEFAULT //[LIGHT, DARK, SYSTEM_DEFAULT]

IDWise.initialize(clientKey=clientKey, theme=theme) { error -> 
       error?.printStackTrace() 
}

IDWise.startJourney method:

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

The following code:

IDWise.startJourney("FLOW_ID", "REFERENCE_NUMBER", "LOCALE", journeyCallbacks)

Should be changed to become:

 IDWise.startJourney(
   		context = this,
     	flowId = "FLOW_ID",
     	referenceNo = "REFERENCE_NUMBER",
     	locale = "LOCALE",
     	applicantDetails = null, //optional
     	journeyCallbacks = journeyCallbacks
  )

IDWise.resumeJourney method:

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

The following code:

IDWise.resumeJourney("FLOW_ID", "YOUR_JOURNEY_ID", journeyCallbacks)

Should be changed to become:

IDWise.resumeJourney(
      context = this,
      flowId = "FLOW_ID",
      journeyId = "JOURNEY_ID
      locale = "LOCALE",
      journeyCallbacks = journeyCallbacks
)

IDWiseSDK Journey Callback Interface Methods

The callback interface type IDWiseSDKCallback is now re-named to IDWiseJourneyCallbacks

onJourneyStarted Callback Method

  • This callback method previously provides journeyInfo: JourneyInfo but now the parameter changed to become journeyStartedInfo: JourneyStartedInfo. The new type JourneyStartedInfo contains Journey Id as a sub field.

The following code:

override fun onJourneyStarted(journeyInfo: JourneyInfo) {
    Log.d("IDWiseSDKCallback", "onJourneyStarted $journeyInfo")
}

Should be changed to become:

override fun onJourneyStarted(journeyStartedInfo: JourneyStartedInfo) {
    Log.d("IDWiseSDKCallback", "onJourneyStarted $journeyStartedInfo")
}

onJourneyResumed Callback Method

  • This callback method previously provides journeyInfo: JourneyInfo but now the parameter changed to become journeyResumedInfo: JourneyResumedInfo. The new type JourneyResumedInfo contains Journey Id as a sub field.

The following code:

 override fun onJourneyResumed(journeyInfo: JourneyInfo) {
    Log.d("IDWiseSDKCallback", "onJourneyResumed $journeyInfo")
 }

Should be changed to become:

 override fun onJourneyResumed(journeyResumedInfo: JourneyResumedInfo) {
    Log.d("IDWiseSDKCallback", "onJourneyResumed $journeyResumedInfo")
 }

onJourneyCompleted Callback Method

  • This callback method previously provides journeyInfo: JourneyInfo and isSucceeded: Boolean but now the parameter changed to become journeyCompletedInfo: JourneyCompletedInfo. The new type JourneyCompletedInfo contains journeyId and isSuccess as a sub fields.

The following code:

 override fun onJourneyCompleted(journeyInfo: JourneyInfo,isSucceeded: Boolean) {
    Log.d("IDWiseSDKCallback", "onJourneyCompleted $journeyInfo")
 }

Should be changed to become:

override fun onJourneyCompleted(journeyCompletedInfo: JourneyCompletedInfo) {
   Log.d("IDWiseSDKCallback", "onJourneyCompleted $journeyCompletedInfo")
}

onJourneyCancelled Callback Method

  • This callback method previously provides journeyInfo: JourneyInfo but now the parameter changed to become journeyCancelledInfo: JourneyCancelledInfo. The new type JourneyCancelledInfo contains Journey Id as a sub field.

The following code:

override fun onJourneyCancelled(journeyInfo: JourneyInfo) {
   Log.d("IDWiseSDKCallback", "onJourneyCancelled $journeyInfo")
}

Should be changed to become:

override fun onJourneyCancelled(journeyCancelledInfo: JourneyCancelledInfo) {
   Log.d("IDWiseSDKCallback", "onJourneyCancelled $journeyCancelledInfo")
}

onError Callback Method

  • This delegate method previously provides parameter of type IDWiseSDKError. But the type of this parameter was changed to become IDWiseError. IDWiseError has now code and message as subfields.

The following code:

  override fun onError(error: IDWiseSDKError) {
    Log.d("IDWiseSDKCallback", "onError ${error.message}")
  }

Should be changed to become:

override fun onError(error: IDWiseError) {
   Log.d("IDWiseSDKCallback", "onError ${error.message}")
}

Dynamic SDK Code Changes

If you are using Dynamic SDK integration please follow the following sections to change your code to be compatible with the new version. Dynamic SDK methods can now be accessed via IDWiseDynamic instead of IDWise.

IDWise.initialize method:

  • IDWise.initialize can now be called as IDWiseDynamic.initialize
  • The theme parameter has its type changed from IDWiseSDKTheme to IDWiseTheme
    The following code:
IDWise.initialize("CLIENT_KEY", IDWiseSDKTheme.SYSTEM_DEFAULT) { error->
	//some error occured                                                                               
}

Should be changed to be like this:

val clientKey = "<YOUR_CLIENT_KEY>"
val theme = IDWiseTheme.SYSTEM_DEFAULT //[LIGHT, DARK, SYSTEM_DEFAULT]

IDWiseDynamic.initialize(clientKey=clientKey, theme=theme) {
    error -> error?.printStackTrace() 
}

IDWise.startDynamicJourney method:

  • IDWise.startDynamicJourney can now be called as IDWiseDynamic.startJourney
  • This method now takes a new optional parameter named applicantDetails which is a HashMap<String,String>. You can pass this parameter as null if you do not intend to use it. For further information, please check the documentation.
  • The parameter journeyDefinitionId is now renamed to flowId
  • The parameter callback is now renamed to journeyCallbacks
  • The parameter stepCallback is now renamed to stepCallbacks

The following code:

IDWise.startDynamicJourney("FLOW_ID", "REFERENCE_NUMBER", "LOCALE", journeyCallbacks,stepCallbacks)

Should be changed to become:

 IDWiseDynamic.startJourney(
     	 context = this,
     	 flowId = "FLOW_ID",
     	 referenceNo = "REFERENCE_NUMBER",
     	 locale = "LOCALE",
     	 applicantDetails = null, //optional
     	 journeyCallbacks = journeyCallbacks,
   		 stepCallbacks = stepCallbacks
  )

IDWise.resumeDynamicJourney method:

  • IDWise.resumeDynamicJourney can now be called as IDWiseDynamic.resumeJourney
  • The parameter journeyDefinitionId parameter is now renamed to flowId
  • The parameter callback is now renamed to journeyCallbacks
  • The parameter stepCallback is now renamed to stepCallbacks

The following code:

IDWise.resumeDynamicJourney("FLOW_ID", "YOUR_JOURNEY_ID", journeyCallbacks, stepCallbacks)

Should be changed to become:

IDWiseDynamic.resumeJourney(
  context = this,
  flowId = "FLOW_ID",
  journeyId = "JOURNEY_ID
  locale = "LOCALE",
  journeyCallbacks = journeyCallbacks,
  stepCallbacks = stepCallbacks
)

IDWise.startStep method:

  • IDWise.startStep can now be called as IDWiseDynamic.startStep

The following code:

IDWise.startStep(context, stepId)

It should be changed to become:

IDWiseDynamic.startStep(context, stepId)

IDWise.skipStep method:

  • IDWise.skipStep can now be called as IDWiseDynamic.skipStep

The following code:

IDWise.skipStep(stepId)

It should be changed to become:

IDWiseDynamic.skipStep(stepId)

IDWise.getJourneySummary method:

  • IDWise.getJourneySummary can now be called as IDWiseDynamic.getJourneySummary

The following code:

IDWise.getJourneySummary() { journeySummary, error ->
  // journeySummary contains the status of all steps and overall journey status 
}

It should be changed to become:

IDWiseDynamic.getJourneySummary() { journeySummary, error ->
  // journeySummary contains the status of all steps and overall journey status 
}

IDWise.finishDynamicJourney method:

  • IDWise.finishDynamicJourney can now be called as IDWiseDynamic.finishJourney

The following code:

IDWise.finishDynamicJourney()

It should be changed to become:

IDWiseDynamic.finishJourney()

IDWise.unloadSDK method:

  • IDWise.unloadSDK can now be called as IDWiseDynamic.unloadSDK

The following code:

IDWise.unloadSDK()

It should be changed to become:

IDWiseDynamic.unloadSDK()

IDWiseSDK Step Callback Interface Methods

The callback interface type IDWiseSDKStepCallback is now re-named to IDWiseStepCallbacks.

onStepCaptured Callback Method

  • This callback method previously provides stepId: String, bitmap: Bitmap?, croppedBitmap: Bitmap? but now the parameter changed to become stepCapturedInfo: StepCapturedInfo. The new type StepCapturedInfo contains stepId,croppedImage and originalImage as a sub fields.

The following code:

 override fun onStepCaptured(stepId: String, bitmap: Bitmap?, croppedBitmap: Bitmap?) {
    //This event triggers when User has captured the image from the camera
 }

Should be changed to become:

override fun onStepCaptured(stepCapturedInfo: StepCapturedInfo) {
    //This event triggers when User has captured the image from the camera
 }

onStepResult Callback Method

  • This callback method previously provides stepId: String, stepResult: StepResult? but now the parameter changed to become stepResultInfo: StepResultInfo. The new type StepResultInfo contains stepId and StepResult as a sub fields.

The following code:

override fun onStepResult(stepId: String, stepResult: StepResult?) {
    Log.d("onStepResult", "Step $stepId result!!")
  }

Should be changed to become:

override fun onStepResult(stepResultInfo: StepResultInfo) {
   Log.d("onStepResult", "$stepResultInfo")
}

onStepCancelled Callback Method

  • This callback method previously provides stepId: String but now the parameter changed to become stepCancelledInfo: StepCancelledInfo. The new type StepCancelledInfo contains stepId as a sub field.

The following code:

  override fun onStepCancelled(stepId: String) {
    Log.d("onStepCancelled", "Step $stepId cancelled!!")
  }

Should be changed to become:

 override fun onStepCancelled(stepCancelledInfo: StepCancelledInfo) {
    Log.d("onStepCancelled", "$stepCancelledInfo")
 }

onStepSkipped Callback Method

  • This callback method previously provides stepId: String but now the parameter changed to become stepSkippedInfo: StepSkippedInfo. The new type StepSkippedInfo contains stepId as a sub field.

The following code:

  override fun onStepSkipped(stepId: String) {
    Log.d("onStepCancelled", "Step $stepId cancelled!!")
  }

Should be changed to become:

 override fun onStepCancelled(stepCancelledInfo: StepCancelledInfo) {
    Log.d("onStepCancelled", "$stepCancelledInfo")
 }

onStepConfirmed Callback Method

  • This callback method is removed and no longer the part of the Step Callbacks