为 Microsoft 团队应用程序创建应用程序包Create an app package for your Microsoft Teams app

团队中的应用程序由应用程序清单 JSON 文件定义,并捆绑到应用程序包及其图标中。Apps in Teams are defined by an app manifest JSON file, and bundled in an app package with their icons. 您需要一个应用程序包来上载和安装团队中的应用程序,并发布到您的业务线应用程序目录或 AppSource。You'll need an app package to upload and install your app in Teams, and to publish to either your Line of Business app catalog or to AppSource.

团队应用程序包是一个 .zip 文件,其中包含以下内容:A Teams app package is a .zip file containing the following:

  • 一个名为 "manifest.json" 的清单文件,它指定您的应用程序的属性,并指向您的体验所需的资源,如其选项卡配置页或其机器人的 Microsoft 应用 ID 的位置。A manifest file named "manifest.json", which specifies attributes of your app and points to required resources for your experience, such the location of its tab configuration page or the Microsoft app ID for its bot.
  • 透明的 "大纲" 图标和完整的 "颜色" 图标。A transparent "outline" icon and a full "color" icon. 有关详细信息,请参阅本主题后面的图标See Icons later in this topic for more information.

创建指令清单Creating a manifest

团队应用程序 Studio可帮助配置你的清单。Teams App Studio can help configure your manifest. 它还包含 React 控件库和卡的可配置示例。It also contains a React control library and configurable samples for cards. 请参阅App Studio 概述See App Studio Overview.

您的清单文件必须命名为 "manifest.json",并且必须是上载包的最高级别。Your manifest file must be named "manifest.json" and be at the top level of the upload package. 请注意,以前生成的清单和包可能支持较旧版本的架构。Note that manifests and packages built previously might support an older version of the schema. 对于团队应用程序,尤其是 AppSource (以前称为 Office 应用商店)提交,必须使用当前清单架构For Teams apps and especially AppSource (formerly Office Store) submission, you must use the current manifest schema.

提示

指定清单开头的架构,以从代码编辑器中启用 IntelliSense 或类似支持:Specify the schema at the beginning of your manifest to enable IntelliSense or similar support from your code editor:

"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.7/MicrosoftTeams.schema.json",

图标Icons

备注

如果您的应用程序包含机器人或邮件扩展,则使用的图标将是上载到 bot 框架中的 bot 注册的图标。If your app contains a bot or messaging extension, the icons used will be the icons uploaded to your bot registration in the Bot Framework.

Microsoft 团队需要两个图标来满足你的应用程序体验,才能在产品中使用。Microsoft Teams requires two icons for your app experience, to be used within the product. 图标必须包含在包中,并通过清单中的相对路径引用。Icons must be included in the package and referenced via relative paths in the manifest. 每个路径的最大长度为2048个字节,图标的格式为 .png。The maximum length of each path is 2048 bytes, and the format of the icon is .png.

颜色color

color 图标在 Microsoft 团队(在应用程序和选项卡库、bot、flyouts 等)中使用。The color icon is used throughout Microsoft Teams (in app and tab galleries, bots, flyouts, and so on). 此图标应为192x192 像素。This icon should be 192x192 pixels. 您的图标可以是任何颜色(或颜色),但背景应为您的品牌化强调文字颜色。Your icon can be any color (or colors), but the background should be your branded accent color. 它还应在图标周围具有少量的填充,以适应图标的 bot 版本的六角裁剪。It should also have a small amount of padding surrounding the icon to accommodate the hexagonal cropping for the bot version of the icon.

outlineoutline

outline在以下位置使用图标:用户已将其标记为 "收藏夹" 的应用栏和邮件扩展。The outline icon is used in these places: the app bar and messaging extensions the user has marked as a "favorite." 此图标必须为32x32 像素。This icon must be 32x32 pixels. 大纲图标必须仅包含白色和透明度(无其他颜色)。Your outline icon must contain only white and transparency (no other colors). 图标可以是白色背景,也可以是透明背景。The icon can be white with transparent background or transparent with a white background. 大纲图标周围的图标周围不应有额外的填充,应尽可能紧密地裁剪,同时仍保持32x32 尺寸。The outline icon should not have extra padding surrounding the icon and should be as tightly cropped as possible while still maintaining the 32x32 dimensions. 以下是几个很棒的示例:Here are a few good examples:

示例大纲图标

例如,假设您的公司是 Contoso。For example, say your company is Contoso. 您可以提交两个图标:You'd submit two icons:

图标展示

以下是图标在 UI 中的显示方式:Here's how the icons would appear in the UI:

通道视图中的 Bot 和 chicletBot and chiclet in Channel view

Bot 和 chiclet UX

弹出Flyout

示例 Contoso 图标

应用栏和主屏幕App bar and home screen

示例 Contoso 图标