【问题标题】:Adaptive card is not rendered on Teams mobile app自适应卡片未在 Teams 移动应用上呈现
【发布时间】:2020-02-18 03:44:37
【问题描述】:

我们有一个外部机器人配置为使用消息端点 Web 挂钩使用 MS Teams 频道。以下是外部机器人发布到 Ms Teams 频道的消息。当通过 Web 浏览器或台式计算机上的 MS Teams 应用程序访问 MS Teams 时,此响应将按预期呈现。但是,在 Android 手机上与 Teams 应用程序一起使用时,卡片不会呈现(看到没有任何内容的空行/块)。想知道这里出了什么问题?移动设备不支持此功能吗?还是我们错过了什么?

   "channelData":{ 
      "tenant":{ 
         "id":"xxxxxxxxxxxxxx"
      }
   },
   "attachments":[ 
      { 
         "contentType":"application/vnd.microsoft.card.adaptive",
         "content":{ 
            "fallbackText":"Adaptive card version not supported",
            "type":"AdaptiveCards",
            "body":[ 
               { 
                  "text":"Here is an adaptive card with a link to a task module",
                  "type":"TextBlock"
               },
               { 
                  "type":"Image",
                  "url":"http://adaptivecards.io/content/cats/1.png"
               }
            ],
            "version":"1.0",
            "actions":[ 
               { 
                  "type":"Action.OpenUrl",
                  "title":"Open Link",
                  "url":"https://teams.microsoft.com/l/task/xxxxx?url=https%3A%2F%2Fwww.wikipedia.com%0A&height=large&width=large&title=Wikipedia-Embed"
               }
            ]
         }
      }
   ],
   "replyToId":"xxxxxx",
   "serviceUrl":"https://smba.trafficmanager.net/amer/",
   "recipient":{ 
      "name":"xxxx xxxx",
      "aadObjectId":"xxxxx",
      "id":"xx:xxxxxxxx"
   },
   "localTimestamp":"2020-02-14T15:21:41.1360000-08:00",
   "channelType":"msteams",
   "from":{ 
      "name":"xxxxxx",
      "id":"xx:xxxxx"
   },
   "type":"message",
   "conversation":{ 
      "conversationType":"personal",
      "tenantId":"xxxxxx",
      "id":"x:xxxxxx"
   }
}```

【问题讨论】:

  • 我正在将您的确切卡片发送到我的网络会话并在 Android 平板电脑上进行确认,它工作正常。也许这里的一位微软人有一个想法......
  • @Jobinesh - 你为什么不接受我的回答?
  • 抱歉 @KyleDelaney 是错误的 :) 您在发现有效负载中的错误时是对的,谢谢。

标签: android json botframework microsoft-teams adaptive-cards


【解决方案1】:

您需要确保卡的“类型”是"AdaptiveCard" 而不是"AdaptiveCards"

 { 
    "fallbackText":"Adaptive card version not supported",
    "type":"AdaptiveCard",
    "body":[ 
       { 
          "text":"Here is an adaptive card with a link to a task module",
          "type":"TextBlock"
       },
       { 
          "type":"Image",
          "url":"http://adaptivecards.io/content/cats/1.png"
       }
    ],
    "version":"1.0",
    "actions":[ 
       { 
          "type":"Action.OpenUrl",
          "title":"Open Link",
          "url":"https://teams.microsoft.com/l/task/xxxxx?url=https%3A%2F%2Fwww.wikipedia.com%0A&height=large&width=large&title=Wikipedia-Embed"
       }
    ]
 }

【讨论】:

    猜你喜欢
    • 2021-04-11
    • 2019-10-29
    • 2021-02-06
    • 1970-01-01
    • 2020-09-06
    • 1970-01-01
    • 2020-01-13
    • 2021-06-17
    • 2019-01-18
    相关资源
    最近更新 更多