// The updated resource…
{"kind":"walletobjects#walletObjectMessage","header":"My Object message header","body":"My Object message body with a <a href="http://play.google.com/store/apps/details?id=com.google.android.apps.maps">Hyperlink<\a>","id":"message_id","messageType":"textAndNotify"},…
예외 처리
3번 이상 알림을 보내려고 하면 QuotaExceededException 응답이 반환됩니다. 패스를 추가로 업데이트하려면 통합 단계에서 설명한 대로 'TEXT_AND_NOTIFY' 대신 'TEXT'를 사용하여 설정할 수 있습니다.
필드 업데이트 및 알림
배경
사용자가 패스를 추가한 후 특정 필드를 업데이트할 때 푸시 알림을 트리거하는 것이 좋습니다. 사용자의 잠금 화면에 알림이 표시되고 패스에 업데이트가 있음을 알립니다. 이 알림은 UPDATE 및 PATCH API 메서드를 사용하여 아래에 정의된 특정 하위 집합의 필드에 대해서만 트리거됩니다. 패스를 업데이트하기 위한 API 호출이 실행되면 다음이 발생합니다.
푸시 알림이 트리거되어 사용자의 잠금 화면에 표시되며, 이 알림은 사용자에게 패스 업데이트를 알립니다.
사용자가 알림을 탭하면 Google 월렛이 패스 앞면 (카드 뷰라고도 함)으로 열리고 화면 상단에 '업데이트 검토' 버튼이 있는 콜아웃이 표시됩니다.
버튼을 클릭하면 업데이트로 변경된 필드를 볼 수 있는 화면으로 이동합니다.
필드 업데이트 알림을 보낼 때의 몇 가지 고려사항
사용자가 패스에 알림을 사용 설정해야 업데이트와 관련된 푸시 알림을 수신할 수 있습니다.
24시간 동안 푸시 알림을 트리거하는 업데이트를 최대 3회 보낼 수 있습니다. Google에서 개발자가 사용자에게 스팸을 전송한다고 판단하면 푸시 알림 전송 할당량을 제한할 수 있습니다.
사용자가 잠금 화면에 보는 푸시 알림은 Google 월렛에서 제어합니다.
notifyPreference 필드는 이 요청에만 존재하는 일시적인 필드입니다. 향후 알림을 트리거하려는 요청의 경우 클래스 또는 객체 요청에서 이 필드를 재설정해야 합니다.
통합 단계
이러한 알림을 트리거하려면 기존 UPDATE 또는 PATCH 호출을 사용하고 notifyPreference를 지정해야 합니다. 클래스 또는 객체의 필드를 업데이트할 때 클래스 또는 객체 요청에 새 필드 notifyPreference를 추가하여 알림을 트리거할 수 있습니다.
사용자에게 패스가 여러 개 있으면 가장 빨리 사용할 수 있는 패스만 표시됩니다. 여러 이벤트 티켓 그룹화에 따라 그룹화된 패스를 추가한 경우 그룹에 속한 패스 중 하나만 알림에 표시됩니다. 하지만 알림을 탭하고 왼쪽과 오른쪽으로 스와이프하면 그룹의 다른 패스도 볼 수 있습니다.
알림은 고정되며 사용자가 알림을 열어본 후에도 자동으로 종료되지 않습니다. class.dateTime.start 후 60분이 지나면 자동으로 종료됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eGoogle Wallet's \u003ccode\u003eTEXT_AND_NOTIFY\u003c/code\u003e message type adds a message to the pass details and triggers a push notification, directing users to view it within the Wallet app.\u003c/p\u003e\n"],["\u003cp\u003eUpdating specific pass fields like event details or seat information using the \u003ccode\u003enotifyPreference\u003c/code\u003e field with \u003ccode\u003enotifyOnUpdate\u003c/code\u003e triggers a push notification, alerting users of changes and allowing them to review them.\u003c/p\u003e\n"],["\u003cp\u003eBoth message and field update notifications are limited to 3 per pass within a 24-hour period to prevent user spam, and require users to have Wallet notifications enabled.\u003c/p\u003e\n"]]],["The core actions described involve using the Google Wallet API to send notifications to users with saved passes. Using the `Add Message API` with `TEXT_AND_NOTIFY`, a message is added to the pass's details and a push notification is sent. Tapping the notification leads users to a message view. Alternatively, updating specific fields like event name or seat using `UPDATE` or `PATCH` APIs and setting `notifyPreference` to `notifyOnUpdate` can trigger similar push notifications. A maximum of three notifications can be sent per 24 hours.\n"],null,["# Trigger Push Notifications\n\nPartner Triggered Notifications\n-------------------------------\n\n### Add Message and Notify\n\n#### Background\n\nAfter a user adds a pass you may want to send them a message related to the\npass and ensure they are notified about it. Using the [Add Message API](/wallet/tickets/events/rest/v1/eventticketclass/addmessage)\nrequest with a `message_type` equal to\n**`TEXT_AND_NOTIFY`** the following occurs:\n\n1. A \"[Message](https://developers.google.com/wallet/reference/rest/v1/Message)\" item is added to the \"back of pass\" (aka [Details\n Template](/wallet/tickets/events/resources/template#details-template)) and a push notification is sent to users with the pass saved.\n2. Once the user taps the notification it opens Google Wallet to the front of the pass (a.k.a. Card view) and the user will see a callout at the top of the screen with a \"View Message\" button.\n3. Clicking the callout will take users to the back of the pass, where new unread messages are highlighted.\n\n#### Some considerations when sending messages with notifications to users\n\n- Users must have notifications enabled for their passes to receive the push notifications related to messages.\n- Messages may contain URIs to your website or app. Hyperlinks must be a website or app related to the pass. It is a violation of the [Acceptable Use Policy](https://payments.developers.google.com/terms/aup) to send users to links not related to the pass.\n- You may send a maximum of 3 messages that trigger a push notification in a 24 hour period. Google may throttle your push notification delivery quota if it deems you are spamming your users.\n- The push notification users see on their lock screen is controlled by Google Wallet.\n- You can use the [UPDATE](/wallet/tickets/events/rest/v1/eventticketclass/update) or [PATCH](/wallet/tickets/events/rest/v1/eventticketclass/patch) methods to edit or remove message data using the regular class or object endpoint.\n\n#### Integration Steps\n\nWhen you want to notify users about a new issuer message added using the\nAddMessage API, you will need to update the [AddMessageRequest](https://developers.google.com/wallet/reference/rest/v1/AddMessageRequest)\nso that the [Message](https://developers.google.com/wallet/reference/rest/v1/Message)\nwhich contains your new text has the [MessageType](https://developers.google.com/wallet/reference/rest/v1/Message#MessageType)\n**TEXT_AND_NOTIFY** instead of **TEXT**.\n\n#### Example JSON Request to add message and notify in a Passes Class\n\n```carbon\n ...\n \"id\": ISSUER_ID.CLASS_ID\",\n \"message\":\n {\n \"header\":\"My Class message header\",\n \"body\": \"My Class message body with a \u003ca href=\"https://wallet.google\"\u003eHyperlink\u003c\\a\u003e\",\n \"id\": \"message_id\",\n \"message_type\": \"TEXT_AND_NOTIFY\"\n },\n ...\n```\n\n#### Example JSON Request to add message and notify in a Passes Object\n\n```carbon\n ...\n \"id\": OBJECT_ID\",\n \"classId\": \"ISSUER_ID.CLASS_ID\",\n \"message\":\n {\n \"header\":\"My Object message header\",\n \"body\": \"My Object message body with a \u003ca href=\"http://play.google.com/store/apps/details?id=com.google.android.apps.maps\"\u003eHyperlink\u003c\\a\u003e\",\n \"id\": \"message_id\",\n \"message_type\": \"TEXT_AND_NOTIFY\"\n },\n ...\n```\n\n#### Example [Response](/wallet/tickets/events/rest/v1/eventticketclass/addmessage#response-body) to add message and notify for a Pass Class\n\n```scilab\n // The updated resource\n …\n {\n \"kind\": \"walletobjects#walletObjectMessage\",\n \"header\": \"My Object message header\",\n \"body\": \"My Object message body with a \u003ca href=\"http://play.google.com/store/apps/details?id=com.google.android.apps.maps\"\u003eHyperlink\u003c\\a\u003e\",\n \"id\": \"message_id\",\n \"messageType\": \"textAndNotify\"\n },\n …\n```\n\n#### Exception handling\n\nAny attempts to notify more than 3 times will yield a\n**QuotaExceededException** response. Any further updates to the\npass can be set using \"**TEXT** \" instead of\n\"**TEXT_AND_NOTIFY** \" as discussed in the [Integration\nSteps](#add-message-and-notify-integration-steps).\n\n### Update Field and Notify\n\n#### Background\n\nAfter a user adds a pass you may want to trigger a push notification when you update certain\nfields. The notification will appear on the user's lock screen and inform them that there is\nan update on their pass. This notification will only trigger for a specific subset of fields\ndefined [below](#update-field-and-notify-supported-fields) using the UPDATE and PATCH\nAPI methods. Once an API call to update the pass is made the following occurs:\n\n1. A push notification is triggered and displayed on the user's lock screen, informing them of a pass update.\n2. Once the user taps the notification it opens Google Wallet to the front of the pass (a.k.a. Card view) and the user will see a callout at the top of the screen with a \"Review update\" button.\n3. Clicking the button brings the user to a screen where they can see the fields that were changed by the update.\n\n#### Some considerations when sending field update notifications\n\n- Users must have notifications enabled for their passes to receive the push notifications related to updates.\n- You may send a maximum of 3 updates that trigger a push notification in a 24 hour period. Google may throttle your push notification delivery quota if it deems you are spamming your users.\n- The push notification that users see on their lock screen is controlled by Google Wallet.\n- The `notifyPreference` field is a transient field that only lives on this request. For future requests when you wish to trigger a notification, you will have to reset this field on the class or object request.\n\n#### Integration Steps\n\nIn order to trigger these notifications, you will need to use the [existing UPDATE or PATCH\ncalls](/wallet/tickets/events/use-cases/updates#use_the_google_wallet_api) and specify the notifyPreference. When updating a field on a class or object, you can\nadd a new field, `notifyPreference`, to the class or object request to trigger the\nnotification.\n\n#### Example JSON Request to update and notify in a Class\n\n```text\n …\n \"dateTime\":\n {\n \"kind\": \"walletobjects#eventDateTime\",\n \"doorsOpen\": \"2024-09-23T19:20:50.00\"\n },\n \"multipleDevicesAndHoldersAllowedStatus\": \"multipleHolders\",\n \"notifyPreference\": \"notifyOnUpdate\",\n …\n \n```\n\nSetting the `notifyPreference` to `notifyOnUpdate` will trigger a notification, provided the updated field is currently supported.\n\n#### Supported fields\n\n##### [EventTicketClass](/wallet/tickets/events/rest/v1/eventticketclass#resource:-eventticketclass)\n\n- eventName\n- eventVenue.name\n- eventvenue.address\n- eventDateTime.doorsOpen\n- eventDateTime.start\n\n##### [EventTicketObject](/wallet/tickets/events/rest/v1/eventticketobject)\n\n- eventSeat.seat\n- eventSeat.row\n- eventSeat.section\n- eventSeat.gate\n\nAutomatic Notifications Triggered by Google Wallet\n--------------------------------------------------\n\n### Upcoming Notification\n\n\nGoogle Wallet sends a notification to the user three hours prior to the\nevent. The event time is defined by\n`class.dateTime.start`.\n\n\nTo receive this notification, the user must have notifications enabled. To check this, they can\nnavigate to **Settings \\\u003e Notifications** and see if **Updates about your passes** is\nturned on.\n\n\nThe notification shows up in the notifications area, and in the lock screen, if the user has\n[notifications enabled for the lock screen](https://support.google.com/android/answer/9079661).\n\n\nThe notification has the following unmodifiable format: \n\n```\n `class.eventName`\n \n```\n\nIf they tap the notification and unlock their device, their pass appears in the Google Wallet app.\n\n\nIf the user has multiple passes, only the soonest useable pass is shown. If they've added grouped\npasses as per [Group multiple Event tickets](/wallet/tickets/events/use-cases/group-multiple), the notification only shows one of the passes in\nthe group. However, when they tap it, the user can swipe left and right to see the other passes in\nthat group.\n\n\nThe notification is pinned and won't auto-dismiss after a user opens it. Auto-dismiss occurs 60\nminutes after `class.dateTime.start`."]]