Transition Guide (Android/Kotlin)
This file helps of finding the corresponding calls of MS8b and events of the MasterController. For further information about the calls and events itself, please use the documentation of either MS8b or MasterController.
Basics
The MS8b was an interface based connection between the app and the SDK. This interface needed to be implemented and was the central interface. The MasterController is now an event based connection between the app and the SDK. You need to implement an event interface where you can send and receive events from or to the SDK.
Init
MS8b
You created a class where all the callbacks were received inside the app. An instance of this class was then passed to the getSdk()
method of the AstSdkFactory
class to get SDK instance.
public static AstSdk getSdk(Context context, AstSdkListener manageListener)
Previously you used
AstStatus init(String locale, byte[] version, String appName);
to start the SDK. This call was followed up by
Object getAppConfigParameter(AstConfigParameter parameter);
Which takes the configuration of the SDK
MasterController
You communicate with the MasterController by creating an instance of the class implementing the event interface.
The instance you create is then used to send events to the MasterController.
For MasterController you provide a class StartEvent extends EventFrameworkEvent
which takes all the necessary configurations
StartEvent(String locale, AppVersion version, String appName, String mcConfig, String certificateChain, String sdkConfig)
As a response you will receive class StartResultEvent extends AbstractStatusEvent
Depending on the status you need either to login or activate.
Activation
If you have no activated users/accounts on the device, you will get the activation callback/event after the successful init of the SDK or MasterController. The StartActivationUserIdAndCodeOnlyEvent
is just an information event.
Quickview
MS8b | MasterController | Description |
---|---|---|
onActivationBegin | StartActivationUserIdAndCodeOnlyEvent | Start of activation flow |
ProvideActivationCodeAndUserIdEvent | ||
StartActivationSetPINEvent | ||
ProvideSetPinEvent | ||
onActivationEnd | KSMActivationResultEvent | End of activation flow |
MS8b
The activation process is the sequence of the three calls:
void onActivationBegin(AstDeviceType deviceType);
void doActivation(AstDeviceType deviceType, String pin, String userID, String activationCode);
void onActivationEnd(AstDeviceType deviceType, AstStatus status);
After those calls you are either logged in or need to login.
MasterController
The process is now split up into two steps.
First step is to send user ID and activation code to the MasterController.
StartActivationUserIdAndCodeOnlyEvent
ProvideActivationCodeAndUserIdEvent
This is followed up by sending the PIN to the MasterController.
StartActivationSetPINEvent
ProvideSetPinEvent
For the result you will also receive an event which gives you the status of the activation process. After That you are either logged in or need to login
ActivationResultEvent
Login
If you have already activated users/accounts on the device, you will get the login callback/event after the successful init of the SDK or MasterController. The StartLoginEvent
is just an information event.
Quickview
MS8b | MasterController | Description |
---|---|---|
onLoginBegin | StartLoginEvent | Start of login flow |
doLogin | LoginEvent | Trigger the login process |
onLoginEnd | LoginResultEvent | Get the result of the login process |
MS8b
void onLoginBegin(AstDeviceType deviceType, List<String> userIdList);
void doLogin(AstDeviceType deviceType, String pin, String userId)
void onLoginEnd(AstDeviceType deviceType, AstStatus status, String loginOtp, String userId, int retryCounter, int retryDelay);
MasterController
The new events are similar to MS8b
StartLoginEvent
LoginEvent
LoginResultEvent
Transaction
Quickview
MS8b | MasterController | Description |
---|---|---|
TriggerBannerEvent | Information about an available transaction | |
onTransactionBlockBegin | StartTransactionEvent | Start closure for transactionflow |
onPinRequiredBegin | TransactionPinRequiredRequestEvent | Start to verify the PIN |
doPinRequired | ProvidePinEvent | Trigger verification of the PIN |
onPinRequiredEnd | ProvidePinResultEvent | Result of PIN verification |
onTransactionBegin | DisplayConfirmationRequestEvent | Reception of the transaction information |
doTransaction | DisplayConfirmationEvent | Confirm or decline of the transaction |
onTransactionEnd | DisplayConfirmationResultEvent | Result of the confirmation or the decline |
onTransactionBlockEnd | TransactionEndEvent | Indication that the transactionflow is finished |
MS8b
For MS8b the SDK triggered the calls for the transaction itself and you had to react to it. All other SDK calls were then blocked by this process.
The calls that are wrapped around the transaction callbacks are
void onTransactionBlockBegin(AstDeviceType deviceType, int timeout);
void onTransactionBlockEnd(AstDeviceType deviceType);
If a PIN is needed for security reasons
void onPinRequiredBegin(AstDeviceType deviceType, AstPinReason reason)
void doPinRequired(AstDeviceType deviceType, AstConfirmation confirm, String pin)
void onPinRequiredEnd(AstDeviceType deviceType, AstStatus status, int retryCounter)
The transaction calls which require the confirmation are
void onTransactionBegin(AstDeviceType deviceType, String displayData, AstConfirmationType confirmationType)
void doTransaction(AstDeviceType deviceType, AstConfirmation confirm, String displayData)
void onTransactionEnd(AstDeviceType deviceType, AstStatus status)
MasterController
In the MasterController you will receive an event which tells you, that there is a transaction available, which you can then request when you are ready.
The event telling that a transaction is available is
TriggerBannerEvent
The MasterController is not blocked by this event flow until you trigger it.
Now you can start the event flow for the Transaction by sending the event to the MasterController
StartTransactionEvent
If you need extra security there is still the opportunity for using a PIN inside the transaction.
TransactionPinRequiredRequestEvent
ProvidePinEvent
ProvidePinResultEvent
The transaction calls with the information and to be confirmed are
DisplayConfirmationRequestEvent
DisplayConfirmationEvent
DisplayConfirmationResultEvent
The transaction process is wrapped up by the event
TransactionEndEvent
Change PIN
Quickview
MS8b | MasterController | Description |
---|---|---|
doPinChangeRequest | StartChangePinEvent | Ask for possibility of changing the pin |
onPinChangeBegin | StartSetNewPinEvent | Start of PIN change flow |
doPinChange | ProvideSetNewPinEvent | Provide old and new PIN |
onPinChangeEnd | ChangePinResultEvent | Result of PIN change |
MS8b
For changing the PIN it is necessary to request the SDK for permission that it can trigger some communication flags that are needed.
void doPinChangeRequest(AstDeviceType deviceType);
void onPinChangeBegin(AstDeviceType deviceType, AstStatus status);
void doPinChange(AstDeviceType deviceType, AstConfirmation confirm, String currentPin, String newPin);
void onPinChangeEnd(AstDeviceType deviceType, AstStatus status, int retryCounter);
MasterController
Also for the change PIN in the MasterController it is needed to ask for permission because the MasterController also needs to set some communication flags.
Therefore the flow of calls is close to the same like in MS8b
StartChangePinEvent
StartSetNewPinEvent
ProvideSetNewPinEvent
ChangePinResultEvent
Errors
MS8b
void onAlert(AstDeviceType deviceType, int subSystem, int errorCode);
void onReport(AstDeviceType deviceType, int reportId);
MasterController
WarningEvent
RuntimeErrorEvent
FatalErrorEvent