Skip to main content
Version: Android SDK 7.1005.0

Events Subscribers

Register events delegate

registerEventsDelegate Method

Registers a delegate for the SDK events.

Parameters

ParameterNotes
listener Required
Object
Any object implementing one or more of the available delegate interfaces.

Code example

public class ObjectHelper implements Events.SmartposRequired, Events.Status, Events.Log, Events.TransactionStarted,  Events.CurrentTransactionStatus, Events.ConnectionStatusChanged, Events.EndOfTransaction, Events.TransactionResultReady {
...
private void setEventsHandler() {
// Register this class as listener for events
this.api.registerEventsDelegate(this);
...
}

}

Returns

ParameterNotes
BooleanTrue if the new delegate was added successfully.

Unregister events delegate

unregisterEventsDelegate Method

Unregisters an object from SDK events.

Parameters

ParameterNotes
listener Required
Object
Any object implementing one or more of the available delegate interfaces.

Code example

public class ObjectHelper implements Events.SmartposRequired, Events.Status, Events.Log, Events.TransactionStarted,  Events.CurrentTransactionStatus, Events.ConnectionStatusChanged, Events.EndOfTransaction, Events.TransactionResultReady {
...
private void unsubscribeEventsDelegate() {
// Stop receiving events
this.api.unregisterEventsDelegate(this);
...
}

Returns

ParameterNotes
BooleanTrue if the new delegate was removed successfully.