DeviceReference
    
    
      
    
    
      
      透過集合功能整理內容
    
    
      
      你可以依據偏好儲存及分類內容。
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
    
    
    
    
      
      
        DeviceReference 是一種 API 抽象化機制,可讓您透過下列其中一種 ID 類型,為方法提供 device 引數:
        
          - 數值 API 資源 ID。
- 製造裝置的實際硬體 ID,例如 IMEI 號碼。
在裝置上運作的方法會採用 DeviceReference 做為參數類型,因為對呼叫端而言,這個類型更具彈性。如要進一步瞭解裝置 ID,請參閱「ID」。
      
      
        
          
            
              | JSON 表示法 | 
          
          
            
              | {
  // Union field devicecan be only one of the following:
  "deviceId": string,
  "deviceIdentifier": {
    object (DeviceIdentifier)
  }
  // End of list of possible types for union fielddevice.
} | 
          
        
      
      
        
          
            
              | 欄位 | 
          
          
            
              | 聯集欄位 device。必要欄位。裝置的專屬 ID。device只能是下列其中一項: | 
            
              | deviceId | string (int64 format)
 裝置的 ID。 | 
            
              | deviceIdentifier | object (DeviceIdentifier)
 裝置的硬體 ID。 | 
          
        
      
    
  
  
  
  
 
  
    
    
      
       
    
    
  
  
  除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
  上次更新時間:2025-07-25 (世界標準時間)。
  
  
  
    
      [null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],["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"]]