The App SDK provides a default UI class for OTP registration and authentication that implements the IOtpLiveData interface.
.png?sv=2026-02-06&spr=https&st=2026-09-30T02%3A15%3A09Z&se=2026-09-30T02%3A26%3A09Z&sr=c&sp=r&sig=2B1hiJLGpMKZNW0e2RL16WPNoattnDfqXc5zl4N8%2B0g%3D)
The class that implements your custom UI must also implement the IOtpLiveData interface. In addition, an object of Digipass S3's default UI class is created by Digipass S3'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.
Create a custom class that implements your UI.
Your custom class calls the following methods in class OtpMethodUI: cancel(), resendCode(), processIdentifier(), processConfirmIdentifier(), processCode(). Refer to the Client API Docs for details on these methods.
Declare that your custom class implements the IOtpLiveData interface. Define the following methods in your custom UI class: onGetIdentifier(), onConfirmIdentifier(), onGetCode(), onFinish() and onCancel(). These method definitions ensure that your class implements the IOtpLiveData interface.
Define a new factory class as a subclass of MethodUIFactory. For example, call this new class SampleMethodUIFactory.
Override your new factory's createMethodUI() method. Refer to SampleMethodUIFactory.kt in the Tutorial App for details on how to write this method.
When you create your factory, set your SampleMethodUIFactory class to the MethodUIFactory instance.
MethodUIFactory.setInstance(new SampleMethodUIFactory());Refer to the Client API Docs for the OtpMethodUI class, the IOtpLiveData interface and the MethodUIFactory class for more details.
Working example in Tutorial app
Refer to files SampleMethodUIFactory.kt and SampleOtpUI.kt for an example implementation.