Change PIN
Once a user has logged in to the application, they can change their pin. The Change Pin flow involves these events.
ChangePin event flow-diagram.
The following diagram shows the working of the change pin process.
iOS/Swift
The user needs to trigger a StartChangePin Event, so for Swift you can trigger that by this snippet:
Triggering StartChangePin Event (Swift)
masterControllerAdapter.sendEvent2MasterController(
KSMStartChangePinEvent(), withCompletionHandler: nil)
Next, you need to send the SetNewPin Event, this is done by the following snippets:
Triggering SetNewPin Event (Swift)
masterControllerAdapter.sendEvent2MasterController(
KSMProvideSetNewPinEvent(currentPin: oldPin,
andPin: newPin),
withCompletionHandler: nil)
Android/Kotlin
Triggering StartChangePin Event (Kotlin)
fun triggerStartChangePinEvent() {
synchronousEventHandler.postEvent(StartChangePinEvent())
}
Next, you need to send the ProvideSetNewPinEvent, this is done by the following snippets:
Triggering SetNewPin Event (Kotlin)
fun triggerProvideSetNewPinEvent(currentPin: String, newPin: String) {
val setNewPinEvent = ProvideSetNewPinEvent(currentPin, newPin)
synchronousEventHandler.postEvent(setNewPinEvent)?.then {
// handle result
}
}