botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Are Facebook Sender Actions working ?

Open gviddy opened this issue 9 years ago • 2 comments

Hi there, I have been trying to get the Facebook typing action to work but I am having no success. This is the API: https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions

I notice it does not have a message item. Is this why I cannot get it to work? I am creating JSON for it, setting it to the message ChannelData but am having no luck.

var typing = context.MakeMessage(); if (typing.ChannelId.Equals("facebook", StringComparison.InvariantCultureIgnoreCase)) { var fbChannelData = new FacebookSenderAction() { SenderAction = "typing_on" }; typing.ChannelData = fbChannelData; await context.PostAsync(typing); }

public class FacebookSenderAction { [JsonProperty("sender_action")] public string SenderAction { get; set; } }

gviddy avatar Dec 07 '16 05:12 gviddy

@gviddy this should have been fixed now and you should be able to send sender action as channel data to Facebook.

Also here is an example on how you can use typing activity to send typing indicator to different channels instead of relying on the channel data: https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Samples/SimpleDispatchDialog/SimpleDispatchDialog.cs#L28

msft-shahins avatar Dec 19 '16 22:12 msft-shahins

@msft-shahins Awesome! Works as expected. thanks! 👍

gviddy avatar Dec 20 '16 01:12 gviddy