DeviceReference
DeviceReference
คือ API นามธรรมที่ช่วยให้คุณระบุอาร์กิวเมนต์ device ให้กับเมธอดได้โดยใช้ตัวระบุประเภทใดประเภทหนึ่งต่อไปนี้
- รหัสทรัพยากร API ที่เป็นตัวเลข
- รหัสฮาร์ดแวร์ในชีวิตจริง เช่น หมายเลข IMEI ของอุปกรณ์ที่ผลิต
เมธอดที่ทำงานในอุปกรณ์จะใช้ DeviceReference
เป็นประเภทพารามิเตอร์เนื่องจากมีความยืดหยุ่นมากขึ้นสำหรับผู้เรียก หากต้องการดูข้อมูลเพิ่มเติมเกี่ยวกับตัวระบุอุปกรณ์ โปรดอ่านตัวระบุ
การแสดง 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 ต้องระบุ ตัวระบุที่ไม่ซ้ำกันสำหรับอุปกรณ์ device ต้องเป็นค่าใดค่าหนึ่งต่อไปนี้ |
deviceId |
string (int64 format)
รหัสของอุปกรณ์
|
deviceIdentifier |
object (DeviceIdentifier )
รหัสฮาร์ดแวร์ของอุปกรณ์
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-11-08 UTC
[null,null,["อัปเดตล่าสุด 2024-11-08 UTC"],[[["`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"]]