Join / Leave Channel

1. Join Channel

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

[[TalkPlus sharedInstance] joinChannel:channelId 
    success:^(TPChannel *tpChannel) {
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];

2. Join InvitationOnly Channel

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

[[TalkPlus sharedInstance] joinChannel:channelId 
    invitationCode:invitationCode 
    success:^(TPChannel *tpChannel) {
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];

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 sharedInstance] leaveChannel:channel 
    deleteChannelIfEmpty:YES 
    success:^{
    // SUCCESS
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];

Last updated