简体   繁体   English

无法在 Teams 中保存自定义应用程序的选项卡

[英]Unable to save tab of custom app in Teams

I've got a problem with assigning my custom app to a team in MS Teams.我在将我的自定义应用程序分配给 MS Teams 中的团队时遇到问题。 So after uploading the app and trying to assign a new tab for it, I can't save the Tab.因此,在上传应用程序并尝试为其分配一个新选项卡后,我无法保存该选项卡。

在此处输入图像描述

Do you have any explanation for this?你对此有什么解释吗? Already checked the validDomains and websiteURL.已经检查了 validDomains 和 websiteURL。

Thanks!谢谢!

It's important to know there are two kinds of tabs:重要的是要知道有两种选项卡:

  1. Personal tabs - if you want the user to have a personal tab experience, like where your app gets installed by a user directly, and appears in the App list on the left of the screen, then this is a "personal" tab.个人选项卡 - 如果您希望用户拥有个人选项卡体验,例如用户直接安装您的应用程序并出现在屏幕左侧的应用程序列表中,那么这是一个“个人”选项卡。

  2. Channel/Group Chat tabs - these are tabs that can be added to an existing channel or an existing group chat.频道/群聊选项卡 - 这些选项卡可以添加到现有频道或现有群聊中。 For these kinds of tabs, when the user adds the tab, they have a small popup that appears that allows them to configure the tab itself.对于这些类型的选项卡,当用户添加选项卡时,他们会出现一个小弹出窗口,允许他们配置选项卡本身。 For instance, let's say your tab was going to show News - this configuration screen would let the user who's installing the tab to the channel/team be able to choose from a list of News sources they want to the tab to actually show.例如,假设您的标签将显示新闻 - 此配置屏幕将允许将标签安装到频道/团队的用户能够从他们希望标签实际显示的新闻来源列表中进行选择。 When you configure a tab like this in the manifest for your app, you're actually telling it the address for this "configuration" screen, which will set the actual final url for the tab itself.当您在应用程序的清单中配置这样的选项卡时,您实际上是在告诉它此“配置”屏幕的地址,这将为选项卡本身设置实际的最终 url。

Inside this small configuration popup, you need to tell Teams when the configuration you offered to the user is complete.在这个小的配置弹出窗口中,您需要告诉 Teams 您提供给用户的配置何时完成。 For instance, if they have made a choice of which News feed they want, you would notify Teams that the configuration is finished, and that Teams can now "activate" the Save button.例如,如果他们选择了他们想要的新闻提要,您将通知团队配置已完成,并且团队现在可以“激活”保存按钮。 You can see more about this over here .你可以在这里看到更多关于这个的信息。

Of course, in many cases, the tab won't have any required configuration.当然,在许多情况下,选项卡不会有任何必需的配置。 In that case, you can immediately tell Teams to enable the Save button.在这种情况下,您可以立即告诉 Teams 启用“保存”按钮。 A sample of this would be:这方面的一个例子是:

 document.addEventListener("DOMContentLoaded", function (event) {
        microsoftTeams.initialize();

        microsoftTeams.getContext(function (context) {

            microsoftTeams.settings.registerOnSaveHandler(function (saveEvent) {

                microsoftTeams.settings.setSettings({
                    entityId: "WhatEverUniqueNameYouWantForYourTab",
                    contentUrl: "https://ThePathToYourActualTab",
                    suggestedDisplayName: "WhateverYouWantTheTabToBeCalled",
                    websiteUrl: "https://OptionalAddressForIfTheyWantAFullScreenExperience",
                    removeUrl: "https://OptionalAddressForARemoveExperience",
                });

                saveEvent.notifySuccess();
            });

            microsoftTeams.settings.setValidityState(true);
        });
    });

So, to be clear, if you want to add a Tab app for a Channel or Group Chat, you basically need to have two pages in your solution - the main tab page, and a page that will appear in the popup you've shown in your original question.因此,需要明确的是,如果您想为频道或群聊添加标签应用程序,您基本上需要在您的解决方案中有两个页面 - 主标签页,以及将出现在您显示的弹出窗口中的页面在你原来的问题中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM