Home

Error trying to open another tab inside an app/tab.

Ashutosh39
Microsoft

Error redirecting using JS in a React app

I have a tab/app installed in teams in which I try to redirect to another tab if some conditions are met.

 

When I try to redirect, it shows me the standard page of whether to open in web or desktop app, but after that it hangs and does not redirect. I used Teams web app for the same activity and in the console, I could see the error during redirection "Mixed content error". But the link I am redirecting to is an https link and is of the form 

url = https://teams.microsoft.com/l/channel/<entityId>/<tabId>?label=Wiki&groupId=<groupId>&tenantId=<tenantId>

I have tried following options to redirect - 

1. 

window.location.href= url //Tabs Url

When viewing the console, I see a mixed content error saying that msteams is being accessed from https page. This is inspte of the fact that I am redirecting to a https url. Also, no redirection.

2.  

microsoftTeams.navigateCrossDomain(url);

   Shows in the console that this method is deprecated but nothing on the documentation page and no redirection.

3. 

microsoftTeams.navigateToTab(tabName...)

What should I change for redirection to be successful?

 

Edit 1:

  1. I tried opening the Teams web app in Edge and it's able to redirect properly using window.location.href.

How to get the same behavior while using Chrome or the Teams desktop app ? When I use them , I get this page Teams Screenshot

 

 

Related Conversations