Issue
I am trying to send a message through Twilio Conversation in Xamarin by Twilio.Conversations.Xamarin.
How can I send a new message? There is IConversation.SendMessageAsync()
method but it takes IMessageOption
interface and I honestly do not know what kind of implementation is needed.
Read many hours in Google but it does not help for me.
Thank you for any help!
Solution
I posted a question in github and @slimethefrozen helped how to do that in Twilio.Conversations.Xamarin.
Here is his answer.
I use this to create the IMessageOption on iOS
var options = new TCHMessageOptions().WithBody(body);
Where body is the text of the message.
On Android I use this:
var options = IMessage.Options().WithBody(body);
Updated: As version 2.0.0, the code to send a message is below.
var clientInstance; // Create an instance for IConversationsClient
await .PrepareMessage().SetBody(messageBody).BuildAndSendAsync(new());
Answered By - Takeo Nishioka
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.