Callback
You can register and receive callbacks as shown below:
The tag
value is a string value for registering or deleting channel events, and should be set to a unique string value.
TalkPlus.addChannelListener(tag, new TalkPlus.ChannelListener() {
@Override
public void onMemberAdded(TPChannel channel, List<TPUser> users) {
// callback fired when new member is added to the channel
}
@Override
public void onMemberLeft(TPChannel channel, List<TPUser> users) {
// callback fired when member leaves the channel
}
@Override
public void onMessageReceived(TPChannel channel, TPMessage message) {
// callback fired when new message is received in the channel
}
@Override
public void onMessageDeleted(TPChannel channel, TPMessage message) {
// callback fired when message is deleted in the channel
@Override
public void onChannelAdded(TPChannel channel) {
// callback fired when a new channel is created
}
@Override
public void onChannelChanged(TPChannel channel) {
// callback fired when the channel is updated
}
@Override
public void onChannelRemoved(TPChannel channel) {
// callback fired when the channel is deleted
}
@Override
public void onMemberMuted(TPChannel channel) {
// callback fired when member is muted
}
@Override
public void onMemberUnMuted(TPChannel channel) {
// callback fired when member is unmuted
}
@Override
public void onMemberBanned(TPChannel channel) {
// callback fired when member is banned
}
@Override
public void onMemberUnBanned(TPChannel channel) {
// callback fired when member is unbanned
}
});
// remove channel listener
TalkPlus.removeChannelListener(tag);
Last updated