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

Replacing the OOB Method UI

Prev Next

The App SDK provides a default UI class for OOB registration and authentication that implements the IOobLiveData interface.

The class that implements your custom UI must also implement the IOobLiveData interface. In addition, an object of Nok Nok's default UI class is created by Nok Nok's MethodUIFactory. Therefore, you must define your own factory class to create an object of your custom UI.

The following steps take you through defining your custom UI class and your custom factory class.

  1. Create a custom class that implements your UI.

  2. Declare that your custom class adopts the IOobLiveData interface. Define the following methods in your custom UI class: onOperationStarted(), onOobReceived(), onFinish(), onOperationCompleted(). These method definitions ensure that your class implements the IOobLiveData interface.

  3. Define a new factory class as a subclass of MethodUIFactory. For example, call this new class SampleMethodUIFactory.

  4. Override your new factory's createMethodUI() method. Refer to SampleMethodUIFactory.kt in the Tutorial App for details on how to write this method.

  5. When you create your factory, set your SampleMethodUIFactory class to the MethodUIFactory instance.

MethodUIFactory.setInstance(SampleMethodUIFactory())

Refer to the Client API Docs for the IOobLiveData interface and the MethodUIFactory class for more details.

Working Examples in Tutorial App

  • Refer to file SampleOobLiveData.kt as a sample of OobLiveData implementation.

  • Refer to file SampleMethodUIFactory.kt as a sample of Method UI factory implementation.

  • Refer to file TutorialAppPlus.kt as a sample enabling custom Method UI factory.