com.pusher.client.channel
Interface SubscriptionEventListener

All Known Subinterfaces:
ChannelEventListener, PresenceChannelEventListener, PrivateChannelEventListener
All Known Implementing Classes:
ExampleApp, PresenceChannelExampleApp, PrivateChannelExampleApp

public interface SubscriptionEventListener

Client applications should implement this interface if they want to be notified when events are received on a public or private channel.

To bind your implementation of this interface to a channel, either:

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.


Method Summary
 void onEvent(String channelName, String eventName, String data)
          Callback that is fired whenever an event that this SubscriptionEventListener has been bound to is received.
 

Method Detail

onEvent

void onEvent(String channelName,
             String eventName,
             String data)
Callback that is fired whenever an event that this SubscriptionEventListener has been bound to is received.

Parameters:
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.


Copyright © 2013 Pusher. All Rights Reserved.