DeviceReference
DeviceReference
是 API 抽象,可讓您使用下列任一 ID 類型,為方法提供 device 引數:
- 數字 API 資源 ID。
- 製造裝置的實際硬體 ID,例如 IMEI 號碼。
在裝置上運作的函式會將 DeviceReference
做為參數類型,因為這對呼叫端來說更具彈性。如要進一步瞭解裝置 ID,請參閱「ID」。
JSON 表示法 |
{
// Union field device can be only one of the following:
"deviceId": string,
"deviceIdentifier": {
object (DeviceIdentifier )
}
// End of list of possible types for union field device .
} |
欄位 |
聯集欄位 device 。必要欄位。裝置的專屬 ID。device 只能是下列其中一項: |
deviceId |
string (int64 format)
裝置的 ID。
|
deviceIdentifier |
object (DeviceIdentifier )
裝置的硬體 ID。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-08 (世界標準時間)。
[null,null,["上次更新時間:2024-11-08 (世界標準時間)。"],[[["`DeviceReference` allows methods to accept a device argument using either a numeric API resource ID or real-world hardware IDs."],["Methods use `DeviceReference` as a parameter for flexibility in identifying devices."],["The `device` field in the JSON representation is a union field, accepting either a `deviceId` or `deviceIdentifier`."],["`deviceId` is a string that represents the unique ID of the device, and `deviceIdentifier` refers to an object containing the hardware IDs."]]],["A `DeviceReference` is used as a device argument in methods, accepting either a numeric API resource ID (`deviceId`) or real-world hardware IDs (`deviceIdentifier`) like IMEI. The JSON representation uses a union field named `device` that contains either a `deviceId` string (int64 format) or a `deviceIdentifier` object, which holds the device's hardware IDs. Methods use this type for increased flexibility in identifying devices.\n"]]