在添加到频道

时间:2017-04-05 18:15:49

标签: javascript microsoft-teams

上下文

我尝试编写一个显示Feed列表的简单Microsoft Teams选项卡。 我可以将我的标签侧面加载到Teams并从Channel“+”菜单中选择它。

问题:

如果我要保存设置,系统会显示一条错误消息“我们无法保存您的标签设置。请重试。”浏览器的javascript错误控制台没有错误。

我的config.html标签javascript代码:     

<script type="text/javascript">
    microsoftTeams.initialize();
    microsoftTeams.settings.registerOnSaveHandler(function (saveEvent) {

        microsoftTeams.settings.setSettings({
            entityId: "example",
            contentUrl: "https://example.com/tab.html",
            suggestedDisplayName: "example",
            websiteUrl: "https://example.com",
            removeUrl: "https://example.com/remove.html"
        });

        saveEvent.notifySuccess();
    });

    function onClick() 
    {
        microsoftTeams.settings.setValidityState(true);
    }
</script>

我的manifest.json

{
  "$schema": "https://statics.teams.microsoft.com/sdk/v0.4/manifest/MicrosoftTeams.schema.json",
  "manifestVersion": "0.4",
  "id": "ee90834a-d649-458d-a4e2-0b0f8d425c11",
  "version": "1.0",
  "name": "WINSider Community Deutschland",
  "developer": {
      "name": "WINSider Community Deutschland",   
      "websiteUrl": "https://windowscommunity.de",
      "privacyUrl": "https://windowscommunity.de/de/impressum/",
      "termsOfUseUrl": "http://windowscommunity.de/de/impressum/"
  },
  "tabs" : [{
    "id": "ee90834a-d649-458d-a4e2-0b0f8d425c11",
    "name": "WINSider Community",
    "description" : {
      "short": "WINsider article list as a tab",
      "full": "Summarizes the windowscommunity.de blog posts as a clickable list."
    },
    "icons": {
      "44": "icon44.png",
      "88": "icon88.png"
    },
    "accentColor" : "#37A3CF",
    "configUrl": "https://tscholze.github.io/public/teamstab/config.html",
    "canUpdateConfig": true
  }],
  "needsIdentity": false,
  "validDomains": [
      "*.github.io",
      "*.github.com",
      "*.googleapis.com",
      "*.microsoft.com",
      "*.rss2json.com",
      "*windowscommunity.de"
  ]
}

2 个答案:

答案 0 :(得分:2)

供您参考

David将答案作为评论发布到我的Github issue。谢谢。

长话短说 允许 @Override public void onBackPressed() { moveTaskToBack(true); } *example.org等域名调用的http://example.org不是http://www.example.org的有效定义。

答案 1 :(得分:1)

您的contentUrlwebsiteUrlremoveUrl似乎正在使用validDomains列表中未包含的域名。这将导致保存失败。