提供附件圖示
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
開發人員可透過日曆外掛程式,使用 EventAttachmentTrigger 將自訂附件新增至日曆活動。這些自訂附件可以選擇指定圖片網址,並在日曆活動中顯示為附件的圖示。由於這些圖片會直接在日曆中使用,因此必須託管在 Google 的基礎架構上。具體來說,您必須使用與外掛程式 Google Workspace Marketplace 商店資訊相同的圖示。
如要取得可做為 attachment.iconUrl
的圖片網址,請按照下列步驟操作:
- 開啟 Google Cloud 控制台。
- 如有必要,請切換至代管外掛程式的專案。
- 依序按一下左上方的「選單」圖示 menu >「API 和服務」。
- 在底部的清單中,按一下「Google Workspace Marketplace SDK」。
- 選取「商店資訊」分頁標籤。
- 在「圖像資源」部分,上傳預期的附件圖示圖片,做為「32x32 應用程式圖示」。
- 複製產生的圖片網址,並做為
attachment.iconUrl
使用。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間: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`."]]