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

Replacing the manage registration UI

Prev Next

The App SDK provides a default UI for registering, deregistering, and renaming UAF and FIDO2 credentials implemented as a Fragment.

This Manage 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 Fragment. Your Fragment (View or Fragment in the sequence diagram below) responds to user input by calling the ManageRegistrationController (Controller) functions to trigger the required functionality such as adding or removing a credential (Model). The ManageRegistrationController calls back to your Fragment to show the updates.

To replace the Manage Registration UI:

  • Implement your own custom Fragment, extending BaseManageFragment.

  • Implement your own custom UI factory, extending ManageUIFactory. For example, call it SampleManageUIFactory. Define createFragment() to instantiate and return your custom Fragment.

  • Initialize the SDK to use your custom UI factory by making the following call: ManageUIFactory.setInstance(SampleManageUIFactory())

The following diagram illustrates the MVC flow when the user removes a method.

The steps in this diagram are described below:

  1. Your app calls AppSDKPlus.manageRegistrations() to obtain an instance of your custom BaseManageFragment class.

  2. The AppSdk calls the createFragment() method of your ManageUIFactory to obtain the instance of your custom BaseManageFragment class.

  3. Your app shows the instance of BaseManageFragment that it just obtained.

  4. Once your Fragment is initialized, it calls the Controller's onRefresh().

  5. The Controller calls the Server to get the list of registrations for the user.

  6. The Controller calls the Live Data's setMethods() with the list of registrations.

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

  8. Your View displays the list of registrations.

  9. The user selects a registration to remove.

  10. Your View calls the Controller's onRemove() with the selected registration.

  11. The Controller removes the registration.

  12. After removing the registration, the Controller calls the Live Data's onOperationCompleted().

  13. 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 ManageRegistrationController, ManageRegistrationViewModel and BaseManageFragment classes.

Working example in Tutorial app

  • Refer to files SampleManageFragment.kt and SampleManageUIFactory.kt for an example implementation.