Barcode
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
欄位 |
kind (deprecated) |
string
標示資源的種類。值:固定字串 "walletobjects#barcode" 。
|
type |
enum (BarcodeType )
條碼類型。
|
renderEncoding |
enum (BarcodeRenderEncoding )
條碼的轉譯編碼。如有指定,則會以指定的編碼轉譯條碼。如未提供,則由 Google 選擇最已知的編碼。
|
value |
string
條碼中的編碼值。
|
alternateText |
string
選用文字,會覆寫條碼下方顯示的預設文字。這個欄位提供使用者能夠理解的條碼值對應內容,條碼無法掃描時即可派上用場。
|
showCodeText |
object (LocalizedString )
條碼為隱藏,需執行點選動作後才會顯示,選填文字。如果票證已啟用智慧感應功能,就會發生這種情形。如果未指定,則由 Google 選擇預設值。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eBarcodes in Google Wallet can be customized with type, rendering encoding, value, alternate text, and display settings for code text.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekind\u003c/code\u003e field is deprecated and should no longer be used.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eshowCodeText\u003c/code\u003e field controls text display when the barcode is hidden, often due to Smart Tap.\u003c/p\u003e\n"],["\u003cp\u003eBarcode values can include an optional human-readable \u003ccode\u003ealternateText\u003c/code\u003e for accessibility.\u003c/p\u003e\n"]]],["The core content describes the structure and fields of a barcode in a JSON format. Key information includes: `type` specifying the barcode type, `renderEncoding` defining how the barcode is rendered, and `value` containing the encoded data. `alternateText` provides a human-readable alternative, while `showCodeText` offers optional text when the barcode is hidden. The `kind` field is deprecated. The document describes each field's data type.\n"],null,["# Barcode\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"type\": enum (/wallet/reference/rest/v1/BarcodeType), \"renderEncoding\": enum (/wallet/reference/rest/v1/BarcodeRenderEncoding), \"value\": string, \"alternateText\": string, \"showCodeText\": { 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#barcode\"`. |\n| `type` | `enum (`[BarcodeType](/wallet/reference/rest/v1/BarcodeType)`)` The type of barcode. |\n| `renderEncoding` | `enum (`[BarcodeRenderEncoding](/wallet/reference/rest/v1/BarcodeRenderEncoding)`)` The render encoding for the barcode. When specified, barcode is rendered in the given encoding. Otherwise best known encoding is chosen by Google. |\n| `value` | `string` The value encoded in the barcode. |\n| `alternateText` | `string` An optional text that will override the default text that shows under the barcode. This field is intended for a human readable equivalent of the barcode value, used when the barcode cannot be scanned. |\n| `showCodeText` | `object (`[LocalizedString](/wallet/reference/rest/v1/LocalizedString)`)` Optional text that will be shown when the barcode is hidden behind a click action. This happens in cases where a pass has Smart Tap enabled. If not specified, a default is chosen by Google. |"]]