如果频道不存在,那么我们创建新的私人频道
let options: [NSObject:AnyObject] = [
TWMChannelOptionFriendlyName: defaultChannel,
TWMChannelOptionUniqueName: defaultChannel,
TWMChannelOptionType: TWMChannelType.Private.rawValue
]
channels?.createChannelWithOptions(options, completion: { (result,
channel) in
if result.isSuccessful(){
channel.joinWithCompletion({ (result) in
if result.isSuccessful(){ ... }})
一旦用户成功加入频道,我们就会向其他用户发送加入同一频道的邀请。
availableChannel.members.inviteByIdentity(other_user_name, completion:
{
(result) in
if result.isSuccessful(){ ... })
但是对于其他用户来说,当其他用户向他发送聊天邀请时,他如何获得通知,在 twilio 聊天的示例应用程序中,我没有收到任何邀请接受的回复。