public void SendMessage(string text) { _channel.SendUserMessage(text, string.Empty, (userMessage, e) => { HandleException(e); }); }
public void SendMessage(string message, ExtraData testData = null) { channel.SendUserMessage(message, testData.ToString(), (sentMessage, e) => { if (e != null) { Debug.LogError(e); // Should also make notification return; } }); }
public void SendBlogPost(string data) { if (_openChannel != null && _openChannel.IsOpenChannel()) { _openChannel.SendUserMessage(data, (UserMessage message, SendBirdException e) => { if (e != null) { Debug.Log(e.Code + ": " + e.Message); return; } blogScreen.AddBlogPost(message); }); } }
public void joinChannelHandler(object sender, EventArgs e) { OpenChannel.GetChannel("testing", (channel, sendExcep) => { if (sendExcep != null) { // An error has occurred while connecting. System.Diagnostics.Debug.WriteLine("An error has occurred " + "in joinChannelHandler while joining"); System.Diagnostics.Debug.WriteLine("error: " + sendExcep.Code); } else { System.Diagnostics.Debug.WriteLine("Success in joining a channel in SendBird!"); } channel.Enter((SendBirdException enterExcep) => { if (enterExcep != null) { System.Diagnostics.Debug.WriteLine("An error has occurred " + "in joinChannelHandler while entering"); System.Diagnostics.Debug.WriteLine("error: " + sendExcep.Code); } }); channel.SendUserMessage("Test", (message, sendUserTestE) => { if (sendUserTestE != null) { System.Diagnostics.Debug.WriteLine("Error occurred when sending user message" + " from inside joinChannelHandler"); System.Diagnostics.Debug.WriteLine("error: " + sendUserTestE.Code); } else { System.Diagnostics.Debug.WriteLine("Successfully sent message"); } }); }); }