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

Replacing the manage registrations UI

Prev Next

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

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 View. Your view (View in the sequence diagram below) responds to user input by calling the NNLManageRegistrationController (Controller) functions to trigger the required functionality such as displaying registrations, adding or removing a credential (Model). The NNLManageRegistrationController calls back to your View through the Manage Registration Live Data to show the updates.

To replace the Manage Registration UI:

  • Implement your own custom View class, extending NNLBaseManageRegistrationViewController and also adopting the NNLIManageRegistrationsLiveData protocol.

  • Implement your own custom UI factory, adopting the NNLIManageRegUIFactory protocol. For example, call it SampleManageRegUIFactory.

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

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 NNLAppSDKPlus.manageRegistrations() to obtain an instance of your custom NNLBaseManageRegistrationViewController class.

  2. The AppSdk calls the createViewController() method of your NNLIManageRegUIFactory to obtain the instance of your custom NNLBaseManageRegistrationViewController class.

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

  4. Once your View 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. The Live Data object calls your View's setMethods() with the list.

  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 onRemoveCompleted().

  13. The Live Data object calls your View's onRemoveCompleted().

Refer to the Client API Docs for the NNLManageRegistrationController and the NNLBaseManageRegistrationViewController classes and the NNLIManageRegistrationsLiveData and NNLIManageRegUIFactory protocols for more details.

Working example in Tutorial app

  • Refer to files SampleManageRegView.swift and SampleManageRegViewTableCell.swift.