簡體   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