Adaptive Card in custom Teams Tab app has an Action.OpenUrl action with an external https link.
Card renders but nothing happens when the action button is clicked. No url opens, no error, nothing in console.
What's wrong?
Here's the adaptive card:
{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.4",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "File Name",
"wrap": true,
"size": "Large",
"id": "file-name"
},
{
"type": "TextBlock",
"text": "File description",
"wrap": true,
"id": "file-desc"
},
{
"type": "Image",
"url": "https://statics.teams.cdn.office.net/evergreen-assets/apps/teams_dev_app_largeimage.png",
"size": "large",
"selectAction": {
"type": "Action.OpenUrl",
"title": "Open File",
"url": "https://www.google.com"
},
"id": "file-thumbnail"
}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Open File",
"url": "https://www.google.com",
"id": "file-link"
}
]
}
And how it's rendered:
import * as AdaptiveCards from "adaptivecards";
export default function showAdaptiveCard(fl) {
let adaptiveCard = new AdaptiveCards.AdaptiveCard();
adaptiveCard.hostConfig = new AdaptiveCards.HostConfig({
//add options
});
adaptiveCard.onExecuteAction = function(action) {
alert("should be opening url");
}
adaptiveCard.parse(card);
let renderCard = adaptiveCard.render();
return renderCard;
}