繁体   English   中英

自适应卡未在 Teams 移动应用上呈现

[英]Adaptive card is not rendered on Teams mobile app

我们有一个外部机器人,配置为使用消息端点 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"
   }
}```

您需要确保卡的“类型”是"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"
       }
    ]
 }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM