【问题标题】:Action.Submit buttons in Adaptive card does not render in Skype自适应卡中的 Action.Submit 按钮不会在 Skype 中呈现
【发布时间】:2018-03-06 15:40:02
【问题描述】:

我有一张简单的自适应卡片,在网络聊天应用中运行良好,这就是卡片

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "Container",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Hello!",
                                    "weight": "bolder",
                                    "isSubtle": true
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "What can I do for you?",
                                    "wrap": true
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "actions": [
        {
            "type": "Action.ShowCard",
            "title": "Buy",
            "card": {
                "type": "AdaptiveCard",
                "body": [
                    {
                        "type": "TextBlock",
                        "text": "What do you want to buy?",
                        "weight": "bolder"
                    }
                ],
                "actions": [
                    {
                        "type": "Action.Submit",
                        "title": "Ticket",
                        "data": {
                            "action_button": "buy_ticket"
                        }
                    }
                ]
            }
        },
        {
            "type": "Action.ShowCard",
            "title": "Check",
            "card": {
                "type": "AdaptiveCard",
                "body": [
                    {
                        "type": "TextBlock",
                        "text": "Nothing to check",
                        "weight": "bolder"
                    }
                ]
            }
        }
    ]
}

您可以通过在此链接http://adaptivecards.io/visualizer/index.html?hostApp=Skype 中粘贴代码来查看它。

您可以在此处看到网络聊天工作正常: 但Skype 甚至不呈现Action.Submit 按钮。

它应该可以工作,因为这种卡类型支持 Skype。

我也在 Android 上测试过,它也有同样的错误。

更新: 我怎样才能创建这样的卡?这是一个Skype机器人。

【问题讨论】:

    标签: node.js botframework skype


    【解决方案1】:

    Skype 当前不完全支持自适应卡,因此这种行为是意料之中的。虽然自适应卡的某些功能可能在 Skype 中工作,但它们并未得到完全支持,因此可以预料到诸如此类的奇怪行为。您可以找到支持和不支持自适应卡的频道列表here

    【讨论】:

    • 在哪里可以找到已经完全支持自适应卡的频道列表?我尝试了 Teams,但尚不支持。
    • @SamuelNLP 祝你好运,老实说,这真的是有限的支持。您可以在此处找到更多详细信息:docs.microsoft.com/en-us/adaptive-cards/resources/partners,上面写着“机器人框架 - 机器人框架支持大多数渠道的自适应卡片。模拟器、DirectLine、WebChat - 完整的原生功能 Facebook、SMS、GroupMe、电子邮件、电报、Slack、Kik -呈现为图像”
    猜你喜欢
    • 2020-05-22
    • 2017-10-27
    • 2018-11-10
    • 1970-01-01
    • 2017-10-28
    • 2017-12-29
    • 2019-04-20
    • 2021-09-12
    • 1970-01-01
    相关资源
    最近更新 更多