提供附件图标
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助日历插件,开发者可以通过使用 EventAttachmentTrigger 将自定义附件添加到日历活动中。这些自定义附件可以选择性地指定一个图片网址,该网址会显示为日历活动内的附件图标。由于这些图片直接在日历中使用,因此您必须将它们托管在 Google 的基础设施上。具体而言,您必须使用与 Google Workspace Marketplace 商店详情中使用的插件图标相同的图标。
如需获取可用作 attachment.iconUrl
的图片网址,请执行以下操作:
- 打开 Google Cloud 控制台。
- 如有必要,请切换到托管插件的项目。
- 点击左上角的“菜单”图标 menu > API 和服务。
- 在底部的列表中,点击 Google Workspace Marketplace SDK。
- 选择商品详情标签页。
- 在图形资源部分中,将所需的附件图标图片上传为应用图标 32x32。
- 复制生成的图片网址,并将其用作
attachment.iconUrl
。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eCalendar add-ons allow developers to add custom attachments with optional icons to Calendar events using the EventAttachmentTrigger.\u003c/p\u003e\n"],["\u003cp\u003eAttachment icons must be hosted on Google's infrastructure and be the same icon used for the add-on's Google Workspace Marketplace store listing.\u003c/p\u003e\n"],["\u003cp\u003eTo obtain the image URL for attachment icons, developers need to upload the icon as an "Application Icon 32x32" in the Google Cloud console's Google Workspace Marketplace SDK Store Listing section and use the resulting URL.\u003c/p\u003e\n"]]],["Developers can add custom attachments to Calendar events using the `EventAttachmentTrigger`. These attachments can have icons, which must be hosted on Google's infrastructure. To get a valid icon URL, navigate to the Google Cloud console, switch to the add-on's project, and access the Google Workspace Marketplace SDK. In the \"Store Listing\" tab's \"Graphics Assets\" section, upload the icon image (32x32) as an \"Application Icon\", then copy and use the generated image URL as the `attachment.iconUrl`.\n"],null,["# Provide attachment icons\n\nCalendar add-ons let developers add custom attachments to Calendar events\nthrough the use of the\n[EventAttachmentTrigger](/apps-script/manifest/calendar-addons#eventattachmenttrigger).\nThese custom attachments can optionally specify an image URL which is displayed\nas the attachment's icon inside of the Calendar event. Since these images are\nused within Calendar directly, you must host them on Google's infrastructure.\nSpecifically, you must use the same icon that you use for the add-ons\nGoogle Workspace Marketplace\n[store listing](/workspace/marketplace/create-listing).\n\nTo obtain an image URL that can be used as the `attachment.iconUrl`:\n\n1. Open the [Google Cloud console](https://console.cloud.google.com/).\n2. If necessary, switch to the project hosting your add-on.\n3. At the top-left, click Menu menu \\\u003e **APIs \\& Services**.\n4. In the list at the bottom, click **Google Workspace Marketplace SDK**.\n5. Select the **Store Listing** tab.\n6. In the **Graphics Assets** section, upload the intended attachment icon image as an **Application Icon 32x32**.\n7. Copy the resulting image URL and use it as the `attachment.iconUrl`."]]