Supported IDEs:
Supported build systems:
Add the repository to your build.gradle file
Add the package dependencies to your build.gradle file
Copy the eventcentre.aar to the libs folder of your application:
Then include the event centre in the dependencies section of your application:
Configuration parameters
Creating the Event Center instance
The emitMessage method is available on the instance of the eventCentre, it is used to send messages to the Event Centre. Only supported message topics will be passed to the Event Centre.
The EventCentreMessageTopics enum contains the following values:
CONTEXT_UPDATE: Topic for covering general UI state updates, for example navigation changes or the user selecting a player in the UI.
SELECTION_UPDATE: Dedicated topic for handling user selection updates. The selected field within the message data handles both selecting and deselecting updates.
The EventCentreMessage type is an alias of a HashMap<String, Any> class. Keys must be Strings and the Values can be any type.
Updating the Context
There is a convinience method to update the context:
This method will update the context of the widget, and receives only the parameter context of type EventCentreContext. This type is a subclass of EventCentreMessage and contains the following properties:
fightId
integer
In order to subscribe to different messages emitted by the SDK, the EventCentreListener interface must be implemented.
Subscribing to status changes
The SDK will send every change in its status using the following Listener method:
The EventCentreStatus enum contains the following values:
INITIALISING: the SDK is initialising and not fully loaded.
INITIALIZED: the SDK is ready to interact.
ACTIVE: All the views are fully loaded.
EMITTING_MESSAGE: the SDK is emitting a message.
INACTIVE: the SDK is closed and can't receive any message.
Subscribing to new messages
To receive context or selection updates from the SDK, the host app must subscribe to the Listener using this method:
The EventCentreMessageTopics enum contains the following values:
HANDSHAKE_ATTEMPT:
HANDSHAKE_FAILED: Dedicated topic to signify the handshake between Event Centre and your site failed to complete. This topic is emitted by the integration library, it should only be subscribed to, not emitted.
HANDSHAKE_REPLY:
APP_LOADED: Topic sent when all the views are fully loaded.
CLEAR_SELECTIONS:
CONTEXT_UPDATE: Topic for covering general UI state updates, for example navigation changes or the user selecting a player in the UI.
SELECTION_UPDATE: Dedicated topic for handling user selection updates. The selected field within the message data handles both selecting and deselecting updates.
OPTIONS_UPDATE:
ERROR: Topic sent if the SDK had any problem to be initialized. This topic is emitted by the integration library, it should only be subscribed to, not emitted.
IMGA SDK is owned and maintained by the IMGA Development team.
Private license