채널 참여 / 나가기
1. 채널에 참여하기
채널에 참여합니다.
Public 타입의 채널은 Owner가 초대하지 않아도 사용자가 임의로 참여할 수 있습니다.
[[TalkPlus sharedInstance] joinChannel:channelId
success:^(TPChannel *tpChannel) {
// SUCCESS
} failure:^(int errorCode, NSError *error) {
// FAILURE
}];
TalkPlus.sharedInstance()?.joinChannel(channelId,
success: { tpChannel in
// SUCCESS
}, failure: { (errorCode, error) in
// FAILURE
})
2. InvitationOnly 채널에 참여하기
초대 전용 채널에 참여합니다.
채널에 정의된 초대 코드(invitationCode
)가 필요합니다. 해당 값을 입력하여 초대 전용 채널에 참여할 수 있습니다.
[[TalkPlus sharedInstance] joinChannel:channelId
invitationCode:invitationCode
success:^(TPChannel *tpChannel) {
// SUCCESS
} failure:^(int errorCode, NSError *error) {
// FAILURE
}];
TalkPlus.sharedInstance()?.joinChannel(channelId,
invitationCode:invitationCode,
success: { tpChannel in
// SUCCESS
}, failure: { (errorCode, error) in
// FAILURE
})
3. 채널 나가기
채널에서 나갑니다.
deleteChannelIfEmpty
파라미터를 true(YES)
로 설정하여 채널을 나갈 때 채널에 남아 있는 멤버가 더 이상 없으면 채널이 삭제됩니다.
[[TalkPlus sharedInstance] leaveChannel:channel
deleteChannelIfEmpty:YES
success:^{
// SUCCESS
} failure:^(int errorCode, NSError *error) {
// FAILURE
}];
TalkPlus.sharedInstance()?.leave(channel,
deleteChannelIfEmpty: true,
success: {
// SUCCESS
}, failure: { (errorCode, error) in
// FAILURE
})
Last updated