【发布时间】:2021-11-26 00:56:26
【问题描述】:
我正在使用 Microsoft Teams Toolkit 创建可配置选项卡。当我在可配置选项卡中时,我想将此选项卡的深层链接保存到我的一个数据库中。但是我看到的是我拥有的应用程序包的应用程序 ID 正在更改。我使用 Teams 工具包生成了应用程序包,然后在不同租户的两个 Teams 频道中上传。我看到两个链接中的应用程序 ID 都已更改。如何确保应用程序 ID 保持不变。还有什么方法可以让我在 Tab 本身中动态获取 app id 和 Tab id?
[![在此处输入图片描述][1]][1]
这是我的代码:
microsoftTeams.getContext((context) => {
teamId = context.groupId;
tenantid = context.tid;
channelId = context.channelId;
const entityId =
"_djb2_msteams_prefix_" +
Util.djb2_hash("<<AppId>>" + ":" + context.entityId.replace(/\+/g, " "));
var ctx ;
if (context.subEntityId || context.channelId) {
ctx = encodeURIComponent(JSON.stringify({
subEntityId: context.subEntityId,
channelId: context.channelId
}));
};```
//How to get the app id and the tab id
linkUrl="https://teams.microsoft.com/l/entity/**<<AppId>>**/"+entityId+"/" + "&context=" + ctx+ "&groupId="+context.groupId+"&tenantId="+context.tid;
});
};
[1]: https://i.stack.imgur.com/T5jGc.png
【问题讨论】:
-
如何将应用部署到两个租户?您使用的不是同一个应用程序包(zip 文件)吗?
-
我正在使用相同的应用程序包 zip 文件。但由于这是一个测试,我没有通过 Team Admin 进行部署,而是转到 Team-> 单击 + 符号-> 底部的 Manage App -> Upload a custom app。
-
在这种情况下,“我拥有的应用程序包的应用程序 ID 正在更改”是什么意思?如果是同一个包,app id是怎么变化的?
标签: microsoft-teams teams-toolkit