Microsoft Teams task module with URL not working

Viewed 588

Tring to trigger a task module that will display a web page. All I was able to get is an empty Task Module with the title, while the specified height and width do not affect nor is the URL displayed.

Displayed Task Module

The task module fetch handler function:

const { TeamsActivityHandler } = require('botbuilder');
class Foo extends TeamsActivityHandler {
/* ... */
  handleTeamsTaskModuleFetch(context, data) {
    return {
      task: {
        type: 'continue',
        value: {
          title: 'Task module title',
          height: 1000,
          width: 700,
          fallbackUrl: 'https://giltichon.com/bar',
          url: 'https://giltichon.com/bar',
        }
      }
    };
  };
};

I've made sure to list the URL in the apps manifest validDomains but still the URL is a no show...

UPDATE: also added composeExtensions property

App manifest:

{
...
  "composeExtensions": [
    {
      "botId": "***",
      "canUpdateConfiguration": true,
      "commands": [],
      "messageHandlers": [
        {
          "type": "link",
          "value": {
            "domains": [
              "giltichon.com"
            ]
          }
        }
      ]
    }
  ],
  "validDomains": [
    "giltichon.com"
  ]
}
1 Answers

Regarding the page not showing, its almost certainly a domain validity issue. It's always worth checking the format of your domains (you just need 'www.contoso.com', not 'https://www.contoso.com'), but in this case, because you have are using a task module, there will be a 'composeExtension' section in your manifest. This has its own "valid domain's" section, in the following format:

"messageHandlers": [ { "type": "link", "value": { "domains": [ "whatever.azurewebsites.net" ] } } ] It looks like you might be missing this additional domain value.

Related