Forum Discussion

dmsaprykin's avatar
dmsaprykin
Copper Contributor
Jul 20, 2022

Send fetch task on onInstallationUpdateAdd

Hi,

I'm working on onboarding experience for my bot and want to add several steps once app is added.

I currently send this prompt that invokes activity and shows the dialog. However I can't find a way to trigger task/fetch without user clicking on a button. Is it possible to force fetch so that user is presented with dialog?

 

Thank you

this.onInstallationUpdateAdd(async (context, next) => {
      // This method is triggered when app is installed
      console.log('onInstallationUpdateAdd', this.dialogState);
      
      const installCard = CardFactory.heroCard(
        'Install App',
        null,
        [{
          type: 'invoke',
          title: 'Install',
          value: {
            type: 'task/fetch',
            install: true
          }
        }]);

      await context.sendActivity({ attachments: [installCard] });
      
      await next();
    });

 

Resources