在 Microsoft Teams 中从选项卡内重定向到另一个选项卡失败 [英] Redirection to another tab from within a tab fails in Microsoft Teams

查看:101
本文介绍了在 Microsoft Teams 中从选项卡内重定向到另一个选项卡失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个选项卡中安装了一个应用程序,并想重定向到另一个选项卡.

I have installed an app in a tab and wanted to redirect to another tab.

选项卡的 url 格式为 https://teams.microsoft.com/l/channel/<entityId>/<tabId>?label=Wiki&groupId=<groupId>&;tenantId=

The url of the tab is of the form https://teams.microsoft.com/l/channel/<entityId>/<tabId>?label=Wiki&groupId=<groupId>&tenantId=<tenantId>

为此,我尝试了以下方法 -

For doing this I have tried the following -

  1. window.location.href= url//Tabs Url

查看控制台时,我看到一个混合内容错误,指出正在从 https 页面访问 msteams.这是因为我正在重定向到 https 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.

microsoftTeams.navigateCrossDomain(url);

在控制台中显示此方法已弃用,但在文档页面上没有显示,也没有重定向.

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

microsoftTeams.navigateToTab(tabName...)

没有错误或任何重定向

1.我应该更改什么才能成功重定向?

2.这样做的正确方法是什么?

编辑 1:

我在问题中发布的链接是深层链接.

The link that I have posted in the question is a deep link.

问题不在于重定向.我可以直接在地址栏中输入 url 并重定向到选项卡.问题在于获取此屏幕.

The problem does not lie in redirection. I can directly enter the url in the address bar and get redirected to the tab. The issue lies with getting this screen.

即使我在 Teams 桌面应用程序中,此后也不会发生重定向,它也会出现.如果我通过 Teams Web 应用程序执行相同的过程,我可以打开控制台并看到一个混合内容警告错误,表明 https 页面正在尝试调用 msteams url.

It appears even when I am within Teams desktop app and no redirection takes place after that. If I do the same process via the Teams web app, I can open the console and see a mixed content warning error that a https page is trying to call a msteams url.

当我在浏览器中直接输入此网址时,即使出现此屏幕,我的团队应用程序也能够显示频道.

When I directly enter this url in browser, even though this screen appears my teams app is able to display the channel.

注意 -

  1. navigateCrossDomain 不会重定向,而是打印到控制台,表明它已被弃用.
  2. navigateToTab 似乎也没有做任何事情,因为它没有在控制台中打印任何错误,也没有执行任何重定向.

编辑 2 -

  1. 我尝试在 Edge 中打开 Teams 网络应用程序,它能够使用 window.location.href 正确重定向.

什么不起作用

  1. 在 Teams 桌面应用内重定向

  1. Redirecting inside Teams desktop app

在 Chrome 中的 Teams Web 应用中重定向

Redirecting in Teams web app in Chrome

使用navigateCrossDomain()重定向

Redirecting using navigateCrossDomain()

推荐答案

有两个选项可以导航到另一个频道选项卡:

There are two options to navigate to another channel tab:

  1. 创建标签深层链接并提供带有 target="_blank" 的超链接.这将首先在浏览器中打开链接,然后将您带到频道选项卡.
  2. 使用 getTabInstances() 并使用 navigateToTab() 执行导航.注意:此方法需要 TabInstance 作为参数.
  1. Create a tab deep link and provide hyper link with target="_blank". This would open up the link in browser first and then take you to channel tab.
  2. Get Tab details using getTabInstances() and use navigateToTab() to perform navigation. Note: This method takes TabInstance as parameter.

这篇关于在 Microsoft Teams 中从选项卡内重定向到另一个选项卡失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆