Forum Discussion
Messaging Extension: task used to show a web page. Close with result?
diegoSpace, When you use "microsoftTeams.tasks.submitTask()", you receive a task module submit request in bot code "OnTeamsTaskModuleSubmitAsync()". You write code inside the method to handle submit request.
subhasish-MSFT Hi, thanks for your response.
Now I receive an event in my bot ('handleTeamsMessagingExtensionSubmitAction' method) with the taskInfo from the web page (for instance when a button is pressed)
When I receive this event I need to change the web page displayed (new content, new window size), so I return a new task in this bot method
It works properly in Teams web ('page2.html' is loaded, so window size is increased)
BUT it does not work for me in Teams desktop ('page2.html' is loaded but window height flicks: 150 -> 250 -> 150)
It happens the same if 2nd page is smaller or bigger than 1st (flick and back to size of page 1)
My code:
handleTeamsMessagingExtensionFetchTask(context, action) {
return {
task: {
type: 'continue',
value: {
width: 500,
height: 150,
title: "Page 1",
url: 'page1.html',
fallbackUrl: 'page1.html'
}
};
}
handleTeamsMessagingExtensionSubmitAction(context, action) {
return {
task: {
type: 'continue',
value: {
width: 500,
height: 250,
title: "Page 2",
url: 'page2.html',
fallbackUrl: 'page2.html'
}
};
}
Thanks,
Diego