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:
IDWise.initialize
method:- The
theme
parameter has its type changed fromIDWiseSDKTheme
toIDWiseTheme
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:
IDWise.startJourney
method:- This method now takes a new optional parameter named
applicantDetails
which is aHashMap<String,String>
. You can pass this parameter asnull
if you do not intend to use it. For further information, please check the documentation. - The parameter
journeyDefinitionId
is now renamed toflowId
- The parameter
callback
is now renamed tojourneyCallbacks
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:
IDWise.resumeJourney
method:- The parameter
journeyDefinitionId
parameter is now renamed toflowId
- The parameter
callback
is now renamed tojourneyCallbacks
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
onJourneyStarted
Callback Method- This callback method previously provides
journeyInfo: JourneyInfo
but now the parameter changed to becomejourneyStartedInfo: JourneyStartedInfo
. The new typeJourneyStartedInfo
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
onJourneyResumed
Callback Method- This callback method previously provides
journeyInfo: JourneyInfo
but now the parameter changed to becomejourneyResumedInfo: JourneyResumedInfo
. The new typeJourneyResumedInfo
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
onJourneyCompleted
Callback Method- This callback method previously provides
journeyInfo: JourneyInfo
andisSucceeded: Boolean
but now the parameter changed to becomejourneyCompletedInfo: JourneyCompletedInfo
. The new typeJourneyCompletedInfo
containsjourneyId
andisSuccess
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
onJourneyCancelled
Callback Method- This callback method previously provides
journeyInfo: JourneyInfo
but now the parameter changed to becomejourneyCancelledInfo: JourneyCancelledInfo
. The new typeJourneyCancelledInfo
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
onError
Callback Method- This delegate method previously provides parameter of type
IDWiseSDKError
. But the type of this parameter was changed to becomeIDWiseError
.IDWiseError
has nowcode
andmessage
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
method:IDWise.initialize
can now be called asIDWiseDynamic.initialize
- The
theme
parameter has its type changed fromIDWiseSDKTheme
toIDWiseTheme
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
method:IDWise.startDynamicJourney
can now be called asIDWiseDynamic.startJourney
- This method now takes a new optional parameter named
applicantDetails
which is aHashMap<String,String>
. You can pass this parameter asnull
if you do not intend to use it. For further information, please check the documentation. - The parameter
journeyDefinitionId
is now renamed toflowId
- The parameter
callback
is now renamed tojourneyCallbacks
- The parameter
stepCallback
is now renamed tostepCallbacks
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
method:IDWise.resumeDynamicJourney
can now be called asIDWiseDynamic.resumeJourney
- The parameter
journeyDefinitionId
parameter is now renamed toflowId
- The parameter
callback
is now renamed tojourneyCallbacks
- The parameter
stepCallback
is now renamed tostepCallbacks
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
method:IDWise.startStep
can now be called asIDWiseDynamic.startStep
The following code:
IDWise.startStep(context, stepId)
It should be changed to become:
IDWiseDynamic.startStep(context, stepId)
IDWise.skipStep
method:
IDWise.skipStep
method:IDWise.skipStep
can now be called asIDWiseDynamic.skipStep
The following code:
IDWise.skipStep(stepId)
It should be changed to become:
IDWiseDynamic.skipStep(stepId)
IDWise.getJourneySummary
method:
IDWise.getJourneySummary
method:IDWise.getJourneySummary
can now be called asIDWiseDynamic.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
method:IDWise.finishDynamicJourney
can now be called asIDWiseDynamic.finishJourney
The following code:
IDWise.finishDynamicJourney()
It should be changed to become:
IDWiseDynamic.finishJourney()
IDWise.unloadSDK
method:
IDWise.unloadSDK
method:IDWise.unloadSDK
can now be called asIDWiseDynamic.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
onStepCaptured
Callback Method- This callback method previously provides
stepId: String, bitmap: Bitmap?, croppedBitmap: Bitmap?
but now the parameter changed to becomestepCapturedInfo: StepCapturedInfo
. The new typeStepCapturedInfo
containsstepId
,croppedImage
andoriginalImage
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
onStepResult
Callback Method- This callback method previously provides
stepId: String, stepResult: StepResult?
but now the parameter changed to becomestepResultInfo: StepResultInfo
. The new typeStepResultInfo
containsstepId
andStepResult
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
onStepCancelled
Callback Method- This callback method previously provides
stepId: String
but now the parameter changed to becomestepCancelledInfo: StepCancelledInfo
. The new typeStepCancelledInfo
containsstepId
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
onStepSkipped
Callback Method- This callback method previously provides
stepId: String
but now the parameter changed to becomestepSkippedInfo: StepSkippedInfo
. The new typeStepSkippedInfo
containsstepId
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
onStepConfirmed
Callback Method- This callback method is removed and no longer the part of the Step Callbacks
Updated 13 days ago