Skip to main content

Activation

INFO: Before proceeding with the activation flow, the user must have an activation code. In general, the user must generate an activation code on the SSMS portal. See the test case description on how to do that.
Our demo app comes with a screen for retrieving an activation code. Note however, that this is only intended for testing, in a real application you usually would not want to sabotage the mechanism for ensuring the user's identity in this way.

When receiving a StartResultEvent with ACTIVATION_REQUIRED as sdkState as a response to the StartEvent the user has to proceed with the Activation flow. The Activation flow involves these events. The User needs to trigger the ActivateEvent to provide the user id, activation code, and desired pin to the Master Controller.

Activation event flow-diagram

The following diagram depicts the event flow of the activation process

iOS/Swift

For Swift, you can trigger that by this snippet:

Triggering KSMActivateEvent (Swift)
public func triggerActivationEvent(activateData: ActivateData){
let userIdentifier = KsUserIdentifier(tenantId: activateData.tenantId, userId: activateData.userId)
let activationEvent = KSMActivateEvent(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

In Kotlin you can use below the code snippet for triggering ActivateEvent:

Triggering ActivateEvent (Kotlin)
fun triggerActivateEvent(
userIdentifier: UserIdentifier,
activationCode: String,
pin: String,
autoLogin: Boolean
) {
val activation = ActivateEvent(userIdentifier, activationCode, pin, autoLogin)

launchIO {
mcEventHandler?.postEvent(activation)?.then {
// handle result
}
}
}

All platforms

As response to ActivateEvent, Master Controller sends a ActivationResultEvent with appropriate status.