Skip to main content

Reactivation (Forgot PIN)

After Activation if user forgets their pin then by Reactivation the user can generate a new pin by providing a new activation code and pin - where the activation code can be generated on the SSMS portal. See the test case description on how to do that.

Reactivation flow consists of these events.

Reactivation event flow-diagram

The following diagram shows the working of reactivation.

iOS/Swift

The user needs to trigger a ReactivationEvent, so for Swift you can trigger that by this snippet:

Triggering ReactivationEvent Event (Swift)
public func triggerReActivationEvent(activateData: ActivateData) {
let userIdentifier = KsUserIdentifier(tenantId: activateData.tenantId, userId: activateData.userId)
let activationEvent = KSMReactivationEvent(userIdentifier: userIdentifier, activationCode: activateData.activationCode, pin: activateData.pin, enableAutoLogin: activateData.enableAutologin)

masterControllerAdapter.sendEvent2MasterController(activationEvent) { event in
guard let newEvent = event else {
return
}
MCHandler.sharedInstance.masterControllerAdapter.receive(newEvent)
}
}

Android/Kotlin

For Kotlin, we have created a dedicated method in the MCHandler class of our example app to trigger this event. Below is the code snippet:

Triggering ReactivationEvent Event (Kotlin)
fun triggerReactivationEvent(
userIdentifier: UserIdentifier,
activationCode: String,
pin: String,
autoLogin: Boolean
) {
val reactivationEvent = ReactivationEvent(userIdentifier, activationCode, pin, autoLogin)
launchIO {
mcEventHandler?.postEvent(reactivationEvent)?.then {
// handle result
}
}
}

All Platforms

As response to ReactivationEvent the Master Controller sends a ReactivationResultEvent with appropriate status.