通知
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
一般票證支援兩種通知類型,您可以設定下列其中一項:
- 近期通知
- 到期通知
近期通知
在時間間隔開始的前 24 小時,使用者會看到近期通知。
服務設定完成後,使用者會看到標題為「genericObject.cardTitle
現在可供使用」的通知以及「查看票證」副標題。
如要設定即將發出的通知,請將布林值 UpcomingNotification.enabledNotification 設為 true
。
到期通知
到期通知會在時間間隔結束前的 48 小時顯示。
設定通知後,使用者會看到標題為「genericObject.cardTitle
到期時間為 [x] 天」的通知,以及標題「查看通行證」的副標題。
如要設定即將發出的通知,請將布林值 ExpiryNotification.enabledNotification 設為 true
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-04 (世界標準時間)。
[null,null,["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eGeneric passes offer two notification types: upcoming and expiry, allowing users to receive timely alerts.\u003c/p\u003e\n"],["\u003cp\u003eUpcoming notifications, triggered 24 hours before a specified time interval, inform users that their generic object is available.\u003c/p\u003e\n"],["\u003cp\u003eExpiry notifications, appearing 48 hours prior to the end of a time interval, remind users of the impending expiration of their generic object.\u003c/p\u003e\n"],["\u003cp\u003eBoth notification types can be easily enabled by setting the respective boolean value (\u003ccode\u003eenabledNotification\u003c/code\u003e) to \u003ccode\u003etrue\u003c/code\u003e in the pass configuration.\u003c/p\u003e\n"]]],["Generic Passes offer upcoming and expiry notifications. Upcoming notifications, appearing 24 hours before the start time, display the pass's card title and \"View pass\" as the subtitle, enabled by setting `UpcomingNotification.enabledNotification` to `true`. Expiry notifications, appearing 48 hours before the end time, show the card title and an \"expires in [x] days\" message with a \"View pass\" subtitle, enabled by setting `ExpiryNotification.enabledNotification` to `true`.\n"],null,["# Notifications\n\nGeneric Passes support two types of notifications, you can configure either:\n\n1. Upcoming notification\n2. Expiry notification\n\nUpcoming notification\n---------------------\n\n[Upcoming notifications](/wallet/generic/rest/v1/genericobject#upcomingnotification)\nappear to the user 24 hours before the [time interval](/wallet/generic/rest/v1/TimeInterval)\nstarts.\n\nWhen the upcoming notification is configured, a notification with the title\n**\"`genericObject.cardTitle` is available now\"** and subtitle **\"View pass\"** will appear to the user.\n\nTo configure upcoming notifications, set the boolean value [UpcomingNotification.enabledNotification](/wallet/generic/rest/v1/genericobject#upcomingnotification)\nto `true`.\n\nExpiry notification\n-------------------\n\n[Expiry notifications](/wallet/generic/rest/v1/genericobject#expirynotification)\nappear 48 hours before the end of the [time interval](/wallet/generic/rest/v1/TimeInterval).\n\nWhen the notification is configured, a notification with the title\n**\"`genericObject.cardTitle` expires in \\[x\\] days\"** and subtitle **\"View pass\"** will appear to the user.\n\nTo configure upcoming notifications, set the boolean value\n[ExpiryNotification.enabledNotification](/wallet/generic/rest/v1/genericobject#expirynotification)\nto `true`."]]