一键重装系统工具 | U盘启动盘制作工具 | 误删文件恢复软件 | 硬盘数据抢救专家 | 电脑蓝屏修复助手 | C盘空间清理神器 | 电脑驱动离线安装工具 | 微信聊天记录恢复工具 | 照片误格式化恢复 | 电脑密码破解清除工具 | 系统崩溃紧急救援盘 | 电脑加速优化大师 | 电脑开不了机怎么重装系统 | 回收站清空了怎么恢复 | 硬盘分区丢失数据恢复 | 电脑卡顿重装系统有用吗 | U盘插入提示格式化数据恢复 | 电脑中毒文件被隐藏恢复 | 忘记电脑开机密码怎么办 | 新硬盘分区对齐工具 | 旧电脑装Win10流畅工具 | SD卡照片删除恢复免费版 | 移动硬盘打不开提示损坏修复 | 电脑无故重启系统修复工具 | 电脑小白一键重装神器 | 程序员电脑环境配置助手 | 设计师电脑字体/素材恢复工具 | 网吧网管系统维护工具箱 | 财务人员电脑发票备份恢复 | 学生党免费电脑系统安装包 | 电脑维修师傅必备工具盘 | 游戏玩家电脑性能优化助手 | 办公白领误删文档恢复软件 | 自媒体视频素材恢复工具 | 网课录制视频损坏修复工具 | 最好的U盘PE系统排名 | 数据恢复软件哪个最强 | 免费电脑助手与收费版区别 | 国产装机工具哪款无广告 | 离线版驱动助手推荐 | 轻量级电脑优化工具对比 | 支持NVMe驱动的PE工具 | 带网络功能的应急启动盘 | 2026最新版万能装机工具 | 支持Win11 24H2的PE工具 | 最新免激活系统重装工具 | 2026数据恢复软件破解版合集 | 纯净无捆绑装机助手V3.0 | 支持苹果M芯片的电脑助手 | 秋季更新版系统维护工具箱 | 电脑系统崩了怎么用U盘把重要资料拷贝出来 | 重装系统前哪些文件夹必须备份 | 固态硬盘误格式化还能恢复数据吗 | 如何制作一个既带PE又能存数据的双分区U盘 | 电脑总是弹窗广告用什么助手彻底拦截 后台管理
📢 欢迎访问系统之家!所有资源均经过安全检测。

Get Contextual Information for Tabs

发布时间:2026-09-21 | 浏览:1
📥 下载地址(文章开头)
电脑助手解决一切电脑问题。
Access to this page requires authorization. You can try signing in or changing directories . Access to this page requires authorization. You can try changing directories . Your tab requires contextual information to display relevant content: Basic information about the user, team, or company. Locale and theme information. The page.id and page.subPageId that identify what is in this tab (known as entityId and subEntityId before TeamsJS v2.0.0). Context about the user, team, or company can be especially useful when: You create or associate resources in your app with the specified user or team. You initiate an authentication flow from Microsoft Entra ID or other identity provider, and you don't require the user to enter their username again. For more information, see authenticate a user in your Microsoft Teams . Although this user information can help provide a smooth user experience, you must not use it as proof of identity. For example, an attacker can load your page in a browser and render harmful information or requests. Access context information You can access context information in two ways: Using URL placeholder values . From the Microsoft Teams JavaScript client library context object. Get context by inserting URL placeholder values Use placeholders in your configuration or content URLs. Microsoft Teams replaces the placeholders with the relevant values when determining the actual configuration or content URL. The available placeholders include all fields on the context object. Common placeholders include the following properties: {page.id} : The developer-defined unique ID for the page defined when first configuring the page . (Known as {entityId} before TeamsJS v2.0.0). {page.subPageId} : The developer-defined unique ID for the subpage this content points defined when generating a deep link for a specific item within the page. (Known as {subEntityId} before TeamsJS v2.0.0). {user.loginHint} : A value suitable as a sign in hint for Microsoft Entra ID. This is usually the sign in name of the current user in their home tenant. (Known as {loginHint} before TeamsJS v2.0.0). {user.userPrincipalName} : The User Principal Name of the current user in the current tenant. (Known as {userPrincipalName} before TeamsJS v2.0.0). {user.id} : The Microsoft Entra object ID of the current user in the current tenant. (Known as {userObjectId} before TeamsJS v2.0.0). {app.theme} : The current user interface (UI) theme such as default , dark , or glass , contrast . (Known as {theme} before TeamsJS v2.0.0). {team.groupId} : The ID of the Microsoft 365 group in which the tab resides. (Known as {groupId} before TeamsJS v2.0.0) {user.tenant.id} : The Microsoft Entra tenant ID of the current user. (Known as {tid} before TeamsJS v2.0.0). {app.locale} : The current locale of the user formatted as languageId-countryId , for example en-us . (Known as {locale} before TeamsJS v2.0.0). The previous {upn} placeholder is now deprecated. For backward compatibility, it's a synonym for {user.loginHint} . Mobile (Android and iOS) versions of Microsoft Teams support only TeamsJS v1.x.x placeholders. For example, in your app manifest if you set your tab configurationUrl attribute to "https://www.contoso.com/config?name={user.loginHint}&tenant={user.tenant.id}&group={team.groupId}&theme={app.theme}" and the signed-in user has the following attributes: Their username is user@example.com . Their company tenant ID is e2653c-etc . They're a member of the Microsoft 365 group with ID 00209384-etc . The user has set their Teams theme to dark . Teams calls the following URL when configuring the tab: https://www.contoso.com/config?name=user@example.com&tenant=e2653c-etc&group=00209384-etc&theme=dark Get context by using the Microsoft Teams JavaScript library You can also retrieve the context information using the Microsoft Teams JavaScript client library . The information can be retrieved by calling microsoftTeams.app.getContext().then((context) => {/*...*/}); . The following code provides an example of context variable: The information can be retrieved by calling microsoftTeams.getContext(function(context) { /* ... */ }) .
📥 下载地址(文章中间)
电脑助手解决一切电脑问题。
The following code provides an example of context variable: Equivalent async/await pattern: Equivalent async/await pattern: The following table lists commonly used context properties of the context object: For more information, see Updates to the Context interface and the Context interface API reference. Retrieve context in private channels Private channels are in private developer preview only. When your content page is loaded in a private channel, the data you receive from the getContext call is obfuscated to protect the privacy of the channel. The following fields are changed when your content page is in a private channel: team.groupId : Undefined for private channels team.internalId : Set to the threadId of the private channel team.displayName : Set to the name of the private channel sharepointSite.teamSiteUrl : Set to the URL of a distinct, unique SharePoint site for the private channel sharepointSite.teamSitePath : Set to the path of a distinct, unique SharePoint site for the private channel sharepointSite.teamSiteDomain : Set to the domain of a distinct, unique SharePoint site domain for the private channel channel.ownerGroupId : Set to the host team groupId of the private channel If your page makes use of any of these values, the value of channel.membershipType field must be Private to determine if your page is loaded in a private channel and can respond appropriately. teamSiteUrl also works well for standard channels. If your page makes use of any of these values, the value of channelType field must be Shared to determine if your page is loaded in a shared channel and can respond appropriately. Get context in shared channels When the content UX is loaded in a shared channel, use the data received from getContext call for shared channel changes. If tab makes use of any of the following values, you must populate the channelType field to determine if the tab is loaded in a shared channel, and respond appropriately. For shared channels, the groupId value is null , since the host team's groupId doesn't accurately reflect the true membership of the shared channel. To address this, the hostTeamGroupID and hostTenantID properties are newly added and useful for making Microsoft Graph API calls to retrieve membership. hostTeam refers to the Team that created the shared channel. currentTeam refers to Team that the current user is accessing the shared channel from. For more information about these concepts and shared channels, see shared channels . Use the following getContext properties in shared channels: For more information on shared channels, see shared channels . Handle theme change By default, the new Teams client supports light theme for apps in Teams meetings. When the app.theme property in getContext API returns the default value, Teams client is in light theme. Earlier version of Teams clients only support Dark and Contrast theme for apps in Teams meetings. You can register your app to be informed if the theme changes by calling microsoftTeams.app.registerOnThemeChangeHandler(function(theme) { /* ... */ }) . The theme argument in the function is a string with a value of default , dark , glass , or contrast . The AppInfo property in the getContext API supports the glass theme for Teams running on Apple Vision Pro devices. The following image shows the default theme option in the Teams: The following image shows the dark theme option in the Teams: Build tabs for Teams Design your tab for Microsoft Teams Enable SSO for tab app Agents and tab apps for shared and private channels App manifest schema for Teams Use dialogs in tabs Was this page helpful? Need help with this topic? Want to try using Ask Learn to clarify or guide you through this topic? Additional resources Last updated on 2026-03-02
📥 下载地址(文章结尾)
电脑助手解决一切电脑问题。