Teams bot task module not showing

42 Views Asked by At

I am trying to implement a task module in my teams bot (Bot framework SDK 4.0). The task module window is invoked but no content is being displayed in it. I am trying to atleast get a webpage like youtube to be displayed in it but it returns the following error message instead if the webpage.

"unable to reach app Please try again.

This is how i invoke the task module:

          'Task Module Card',
          null,
          CardFactory.actions([
            {
              type: 'invoke',
              title: 'Task module',
              value: {
                type: 'task/fetch',
                data: '1234567890'
              }
            }
          ])
        );

        const message = {
          type: ActivityTypes.Message,
          attachments: [taskModuleCard],
        };
        
        
        await context.sendActivity(message); 

and in the Index.js, this is how i send the response :

server.post("/api/messages", async (req, res) => {
  await adapter.process(req, res, async (context) => {
    console.log("await endpoint")
    await bot.run(context);
    if(context.activity.type == 'invoke' && context.activity.name == 'task/fetch'){
const taskModuleInfo = {
        title: 'Task Module',
        height: 'medium',
        width: 'medium',
        url: "https://youtube.com",
        fallbackUrl: "https://youtube.com"
      };
      const response = {
        task: {
          type: 'continue',
          value: taskModuleInfo
        }
      };

      return await context.sendActivity(response);

In the manifest file, i have added "youtube.com" as a valid domain:

 "validDomains": [ " * ", " * . youtube.com" ],

I want to understand why the webpage is not being displayed in the task module.

0

There are 0 best solutions below