0

I'm following this: https://developers.facebook.com/docs/messenger-platform/webview/sharing

I've created custom classes :

[JsonObject(MemberSerialization.OptIn)]
        public class elements
        {
            [JsonProperty]
            public string title { get; set; }
            [JsonProperty]
            public string image_url { get; set; }
            [JsonProperty]
            public string subtitle { get; set; }
            [JsonProperty]
            public default_action default_action { get; set; }
            [JsonProperty]
            public buttons[] buttons { get; set; }
        }
        [JsonObject(MemberSerialization.OptIn)]
        public class default_action
        {

            [JsonProperty]
            public string type { get; set; }

            [JsonProperty]
            public string url { get; set; }
        }
        [JsonObject(MemberSerialization.OptIn)]
        public class buttons
        {

            [JsonProperty]
            public string type { get; set; }

            [JsonProperty]
            public string url { get; set; }

            [JsonProperty]
            public string title { get; set; }
        }

Then, in method :

elements e = new elements();

                    e.default_action.type = "web_url";
                    e.default_action.type = "https://www.youtube.com/watch?v=kOkQ4T5WO9E";
                    e.title = "title";

                    List<buttons> list = new List<buttons>();
                    buttons b = new buttons();
                    b.title = "button title";
                    b.type = "web_url";
                    b.url = "https://www.youtube.com/watch?v=kOkQ4T5WO9E";
                    list.Add(b);
                    e.buttons = list.ToArray();

                    msg.ChannelData = e;
                    msg.Text = "test";

But it throws an error. In bot framework dashboard can't see an issue. How to debug this ?

Ezequiel Jadib
  • 14,767
  • 2
  • 38
  • 43
ed sheran
  • 13
  • 1
  • 5
  • Possible duplicate of [Debugging/testing facebook messenger bot](http://stackoverflow.com/questions/37399219/debugging-testing-facebook-messenger-bot) – Manuel Allenspach Mar 29 '17 at 12:59

1 Answers1

1

Take a look to the Microsoft Bot Framework .NET - Enrich your conversation with Facebook Messengers Webview video. It shows you how to utilize the Facebook Messenger extension to provide a Webview experience in your Bot Framework chatbot.

The demo code of the video is here.

Ezequiel Jadib
  • 14,767
  • 2
  • 38
  • 43