对于 url 类型的按钮,Web url 不能为空

Web url cannot be empty for url type button

 var msg = context.MakeMessage();


            msg.Attachments = new List<Attachment>();

            SigninCard card = new SigninCard()
            {
                 Text= "link it",

                Buttons = new List<CardAction>
                         {
                             new CardAction
                            {

                                Value = "account linking url https",
                                Type = "account_link",
                                Title = "Link"

                            },

                        }
            };

            msg.Attachments.Add(card.ToAttachment());


 await context.PostAsync(msg);

我正在尝试使用 SignInCard 登录 link Facebook 帐户。 出现此错误:

{"error":{"message":"(#100) Web url cannot be empty for url type button","type":"OAuthException","code":100,"error_subcode":2018041,"fbtrace_id":"GclYUUuTL2D"}}

但是url字段中有一个字符串https url。

有什么想法吗?

我想通了。

var msg = context.MakeMessage();


            dynamic messageData = new JObject();
            messageData.attachment = new JObject();
            messageData.attachment.type = "template";
            messageData.attachment.payload = new JObject();
            messageData.attachment.payload.template_type = "generic";


            messageData.attachment.payload.elements
                = new JArray(
                    new JObject(
                        new JProperty("title", "title"),
                        new JProperty("subtitle", "Link your account"),
                        new JProperty("buttons",
                            new JArray(
                                new JObject(
                                    new JProperty("type", "account_link"),
                                    new JProperty("url", "yourUrl")
                                )
                            )
                        )
                    )
                );


            msg.ChannelData = messageData;


                await context.PostAsync(msg);

您不必进入特定频道 ChannelData。在 SigninCard 的 Buttons 初始值设定项中,而不是

Type = "account_link",

使用

Type = ActionTypes.Signin,

在我的 Facebook Messenger 频道上工作。