Digipass S3 is now DigipassONE. This section is currently being updated to reflect our new name.

Replacing the Suggest Registration UI

Prev Next

The App SDK provides a default UI for Suggest Registration implemented as Fragments.

Suggest Registration uses the Model-View-Controller (MVC) architecture, which makes it easy to replace the UI without having to reimplement the core logic. To use your own UI, you need to provide your own implementation of the Fragments. Your Fragments (View or Fragment in the sequence diagram below) use the SuggestRegistrationController (Controller) class, which responds to the user input from your UI and calls the internal SDK functions (Model) to trigger the required functionality such as displaying candidate registration sequences or performing registration with a method in the sequence. The SuggestRegistrationController calls back to your Fragments to show the updates.

To replace the Suggest Registration UI:

  • Implement your own custom Fragment by extending BaseSuggestRegFragment. Register observers for all needed livedata methods to get callbacks from the controller.

  • Implement your own custom UI factory by extending SuggestRegUIFactory. For example, call it SampleSuggestRegUIFactory.

  • Initialize the SDK to use your custom factory by making the following call:
    SuggestRegUIFactory.setInstance(SampleSuggestRegUIFactory())

The following diagram illustrates the MVC flow when the user interacts with Suggest Registration and agrees to register an authentication method. The yellow boxes represent your code.

The steps in this diagram are described below:

  1. After your Fragment is initialized, it calls the Controller's processAnswer().

  2. The Controller calls the Live Data's askPermission().

  3. The Live Data object posts a value to the askPermission object which is observed on your Fragment to trigger a callback.

  4. Your Fragment asks the user if they would like to try to register a passwordless authenticator.

  5. The user responds yes.

  6. Your Fragment calls the Controller's processAnswer().

  7. The Controller calls the Server to get the list of passwordless authenticators.

  8. The Controller calls the Live Data's setMethods() with the list of authenticators.

  9. When Live Data’s setMethods() is called, the observer on your Fragment is notified and the observer’s callback function is called.

  10. Your Fragment displays the list of passwordless authenticators.

  11. The user selects a method.

  12. Your Fragment calls the Controller's doRegister() with the selected method.

  13. The Controller registers the selected authentication method.

  14. On completion of the registration, the Controller calls the Live Data's onOperationCompleted().

  15. When Live Data’s onOperationCompleted() is called, the observer on your Fragment is notified and the observer’s callback function is called.

Refer to the Client API Docs for the BaseSuggestRegFragment, SuggestRegUIFactory, and the SuggestRegistrationController classes. Also see the ISuggestRegLiveData interface.

Working Examples in Tutorial App

  • Refer to files SampleSuggestRegFragment.kt and SampleSuggestRegActivity.kt, SampleSuggestRegUIFactory.kt for an example implementation.