我下面這個網站的觀點:https://developers.facebook.com/docs/messenger-platform/webview/sharing如何顯示在Messenger中
我已經創建自定義類:
[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; }
}
然後,在方法:
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";
但它拋出一個錯誤。在bot框架儀表盤中看不到問題。 如何調試?
[Debugging/testing facebook messenger bot]可能的副本(http://stackoverflow.com/questions/37399219/debugging-testing-facebook-messenger-bot) – Manu