SBDMain.initWithApplicationId(appId)
SBDMain.connectWithUserId(userId, completionHandler: {
(user:SBDUser?, err:SBDError?) in
SBDMain.addChannelDelegate(self, identifier:handlerId)
// get channel
SBDGroupChannel.getChannelWithUrl(channelUrl, completionHandler: {
(channel:SBDGroupChannel?, err:SBDError?) in
// send message
channel?.sendUserMessage(message, completionHandler: {
(message:SBDUserMessage?, err:SBDError?) in
// message sent
})
})
})
override func channel(sender: SBDBaseChannel,
didReceiveMessage message: SBDBaseMessage) {
// message received
}
Sendbird.init(appId, context);
Sendbird.addChannelHandler(handlerId, new Sendbird.ChannelHandler() {
@Override
public void onMessageReceived(BaseChannel baseChannel, BaseMessage baseMessage) {
// message received
}
});
Sendbird.connect(userId, new ConnectHandler() {
@Override
public void onConnected(User user, SendbirdException e) {
// get channel
GroupChannel.getChannel(channelUrl, new GroupChannel.GroupChannelGetHandler() {
@Override
public void onResult(GroupChannel groupChannel, SendbirdException e) {
// send message
groupChannel.sendUserMessage(message,
new BaseChannel.SendUserMessageHandler() {
@Override
public void onSent(UserMessage userMessage, SendbirdException e) {
// message sent
}
});
}
});
}
});
const sb = new Sendbird({ appId : 'YOUR-APP-ID' });
const channelHandler = new sb.ChannelHandler();
channelHandler.onMessageReceived = (channel, message) => {
// message received
};
sb.addChannelHandler(handlerId, channelHandler);
sb.connect(userId, (user, err) => {
// get channel
sb.GroupChannel.getChannel(channelUrl, (channel, err) => {
// send message
channel.sendUserMessage(message, (message, err) => {
// message sent
});
});
});
SendbirdClient.Init(appId);
const SendbirdClient.ChannelHandler channelHandler = new SendbirdClient.ChannelHandler();
channelHandler.OnMessageReceived = (BaseChannel baseChannel, BaseMessage baseMessage) => {
// messag