Message
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
字段 |
kind (deprecated) |
string
指明资源的类型。值:固定字符串 "walletobjects#walletObjectMessage" 。
|
body |
string
消息正文。
|
displayInterval |
object (TimeInterval )
向用户显示消息的时间段。您可以为每条消息定义 startTime 和 endTime 。除非设置了 startTime ,否则在插入 Wallet Object 后会立即显示一条消息。如果未提供 endTime ,消息将一直显示在消息列表中。
|
id |
string
与消息关联的 ID。此字段便于进行消息管理。请注意,同一类/实例中的多条消息之间可能会有重复的 ID 值,因此必须小心谨慎,为每条消息选择合理的 ID。
|
messageType |
enum (MessageType )
消息类型。
|
localizedBody |
object (LocalizedString )
已翻译的消息正文字符串。
|
MessageType
枚举 |
MESSAGE_TYPE_UNSPECIFIED |
|
TEXT |
以文本形式在卡片详情屏幕上呈现消息。这是默认的消息类型。 |
text |
TEXT 的旧别名,已弃用。
|
EXPIRATION_NOTIFICATION |
注意:目前不支持此枚举。 |
expirationNotification |
EXPIRATION_NOTIFICATION 的旧别名,已弃用。
|
TEXT_AND_NOTIFY |
以文本形式在卡片详情屏幕上呈现消息以及 Android 通知。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eWallet Object Messages can be displayed to users with valuable content, including a header, body, and display interval.\u003c/p\u003e\n"],["\u003cp\u003eMessages can be customized with localized headers and bodies for different languages.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMessageType\u003c/code\u003e determines how the message is rendered, with options for text display and Android notifications.\u003c/p\u003e\n"],["\u003cp\u003eEach message has a unique ID for management purposes, and a display interval can be set to control when it is shown.\u003c/p\u003e\n"]]],["The document outlines the structure of a message to be displayed, represented in JSON. Key fields include `header` and `body` for the message content, `displayInterval` to control visibility duration, and `id` for message management. `messageType` specifies how the message is displayed, with options like `TEXT` (default), or `TEXT_AND_NOTIFY`. Localized versions of the `header` and `body` are also supported.\n"],null,["# Message\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [MessageType](#MessageType)\n\nA message that will be displayed with a Valuable\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"header\": string, \"body\": string, \"displayInterval\": { object (/wallet/reference/rest/v1/TimeInterval) }, \"id\": string, \"messageType\": enum (/wallet/reference/rest/v1/Message#MessageType), \"localizedHeader\": { object (/wallet/reference/rest/v1/LocalizedString) }, \"localizedBody\": { object (/wallet/reference/rest/v1/LocalizedString) } } ``` |\n\n| Fields ||\n|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` **(deprecated)** | `string` | This item is deprecated! Identifies what kind of resource this is. Value: the fixed string `\"walletobjects#walletObjectMessage\"`. |\n| `header` | `string` The message header. |\n| `body` | `string` The message body. |\n| `displayInterval` | `object (`[TimeInterval](/wallet/reference/rest/v1/TimeInterval)`)` The period of time that the message will be displayed to users. You can define both a `startTime` and `endTime` for each message. A message is displayed immediately after a Wallet Object is inserted unless a `startTime` is set. The message will appear in a list of messages indefinitely if `endTime` is not provided. |\n| `id` | `string` The ID associated with a message. This field is here to enable ease of management of messages. Notice ID values could possibly duplicate across multiple messages in the same class/instance, and care must be taken to select a reasonable ID for each message. |\n| `messageType` | `enum (`[MessageType](/wallet/reference/rest/v1/Message#MessageType)`)` The message type. |\n| `localizedHeader` | `object (`[LocalizedString](/wallet/reference/rest/v1/LocalizedString)`)` Translated strings for the message header. |\n| `localizedBody` | `object (`[LocalizedString](/wallet/reference/rest/v1/LocalizedString)`)` Translated strings for the message body. |\n\nMessageType\n-----------\n\n| Enums ||\n|----------------------------|-------------------------------------------------------------------------------------------|\n| `MESSAGE_TYPE_UNSPECIFIED` | |\n| `TEXT` | Renders the message as text on the card details screen. This is the default message type. |\n| `text` | Legacy alias for `TEXT`. Deprecated. | This item is deprecated! |\n| `EXPIRATION_NOTIFICATION` | Note: This enum is currently not supported. |\n| `expirationNotification` | Legacy alias for `EXPIRATION_NOTIFICATION`. Deprecated. | This item is deprecated! |\n| `TEXT_AND_NOTIFY` | Renders the message as text on the card details screen and as an Android notification. |"]]