public interface SubscriptionEventListener
To bind your implementation of this interface to a channel, either:
Pusher.subscribe(String) to subscribe and
receive an instance of Channel.Channel.bind(String, SubscriptionEventListener) to bind your
listener to a specified event.
Or, call
Pusher.subscribe(String, ChannelEventListener, String...)
to subscribe to a channel and bind your listener to one or more events at the
same time.
| Modifier and Type | Method and Description |
|---|---|
void |
onEvent(java.lang.String channelName,
java.lang.String eventName,
java.lang.String data)
Callback that is fired whenever an event that this
SubscriptionEventListener has been bound to is received.
|
void onEvent(java.lang.String channelName, java.lang.String eventName, java.lang.String data)
channelName - The name of the channel that the event has been received on.
This is useful if your ChannelEventListener has
been bound to events on more than one channel.eventName - The name of the event that has been received. This will always
be one of the events that your
ChannelEventListener has been bound to.data - The JSON data that was included with the event. This can be
parsed with Google's Gson library, which is a dependency of
this library, or your library of choice.