Join / Leave Channel

1. Join Channel

Anyone can join a public channel even without invitation from the owner.

TalkPlus.joinChannel(channelId, 
    new TalkPlus.CallbackListener<TPChannel>() {
        @Override
        public void onSuccess(TPChannel tpChannel) { 
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

2. Join InvitationOnly Channel

In order to join an invitationOnly channel, you need to know the channel’s invitationCode.

TalkPlus.joinChannel(channelId, 
    invitationCode, 
    new TalkPlus.CallbackListener<TPChannel>() {
        @Override
        public void onSuccess(TPChannel tpChannel) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
);

3. Leave Channel

If you are the last remaining channel member and you set deleteChannelIfEmpty parameter to true when leaving the channel, the channel will be deleted.

TalkPlus.leaveChannel(channel, 
    deleteChannelIfEmpty, 
    new TalkPlus.CallbackListener<Void>() {
        @Override
        public void onSuccess(Void aVoid) {
        }
        @Override
        public void onFailure(int errorCode, Exception exception) {
        }
    }
)

Last updated