2017-04-05 21 views
0

語境:微軟團隊標籤是無法在添加到某個渠道來保存設置

我嘗試寫一個顯示提要列表一個簡單的微軟團隊選項卡。 我可以將我的選項卡載入小組,並從頻道「+」菜單中選擇它。

問題:

如果我想保存我的設置,會出現一個錯誤的文字:「我們無法保存您的標籤設置,請重試。」我的瀏覽器的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" 
    ] 
} 

回答

1

爲了您的信息

大衛張貼的答案,以我的Github issue評論。謝謝。

長話短說 *example.org允許跨域調用,就像http://example.orghttp://www.example.org是不是一個有效的定義畸形兒一validDomain

0

它看起來像你的contentUrlwebsiteUrl,並removeUrl使用的域不您的validDomains列表。這將導致保存失敗。

+0

對不起,重複的答案。 「example.org」網址旨在用作匿名佔位符。對不起,這個不匹配。 contentUrl,websiteUrl和removeUrl鏈接到'tscholze.github.io /.../ page.html'東西。 – Tobonaut