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 a View.

This 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 this View. Your view (View or Fragment in the sequence diagram below) responds to user input by calling the NNLSuggestRegistrationController (Controller) functions, which responds to the user input from your UI and calls the internal SDK functions to trigger the required functionality such as displaying candidate registration sequences (Model) or performing registration with a method in the sequence. The NNLSuggestRegistrationController calls back to your View through the Live Data to show the updates.

To replace the Suggest Registration UI:

  • Implement your own custom ViewController class, extending NNLBaseSuggestRegViewController and adopting the ISuggestRegistrationLiveData protocol.

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

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

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

Most applications are configured to trigger Suggest Registration during Sign-in flow. In that case, the SDK makes this call immediately prior to the flow in the diagram:

NNLSuggestRegUIFactory.getInstance().createViewController(). To trigger Suggest Registration directly from your application, make this call:

AdaptiveUI.suggestRegister().

The steps in this diagram are described below:

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

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

  3. The Live Data object calls your View's askPermission().

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

  5. The user responds yes.

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

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

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

  9. The Live Data object calls your View's setMethods() with the list.

  10. Your View displays the list of suggested passwordless authenticators.

  11. The user selects a method.

  12. Your View 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. The Live Data object calls your View's onOperationCompleted().

Refer to the Client API Docs for the NNLBaseSuggestRegViewController and NNLSuggestRegistrationController classes, and the NNLISuggestRegUIFactory and ISuggestRegistrationLiveData protocols for more details.

Working example in Tutorial app

  • Refer to files SampleSuggestRegisterView.swift and SampleRegMethodCell.swift for an example implementation.

  • Refer to RegistrationTask.swift file for usage.