Teams not passing correct Channel ID to Canvas app
We have built a canvas app and deployed it on multiple Microsoft Teams Channels. On App start up we have used the Param("channelId") to get the channel ID passed from Teams and use it in application logic. The first time the app is opened through teams everything works as expected.
The issue happens when a user switches to a different teams channel. We can see that the query string is passing the correct (updated) channel id like this
but Param("channelId") still gives us the old channel id. (I have placed the channel id on the first page of the canvas app)
If we refresh the teams page (When using Teams through browser) the id gets corrected. If we use the desktop version of the Teams app we would have to log out and log back in to get the correct ID.
Looks like Teams is doing some cache somewhere but i cant figure out how to fix it. Any help would be appreciated.
I personally develop to the Web browser for the most part. There is still a lot of integration happening at Microsoft on Desktop teams integration. As a rule Web teams will allow the application to run a little faster also. as an example Teams desktop will not pass location even though both power apps and teams ask for permission to use the option on load, and the web version works perfectly.