# GCKDevice Class

[Instance Methods](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#pub-methods) \| [Properties](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#properties) GCKDevice Class Reference

## Overview

An object representing a receiver device.

Inherits NSObject, \<NSCopying\>, and \<NSCoding\>.

|---|---|
| ## Instance Method Summary ||
| (BOOL) | - [isSameDeviceAs:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a431377a90931ac06c20d76c87f02d383) |
|   | Tests if this device refers to the same physical device as another. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a431377a90931ac06c20d76c87f02d383) |
|   ||
| (BOOL) | - [hasCapabilities:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ac9462ff1c1707daa727573b385eb5be3) |
|   | Returns `YES` if the device supports the given capabilities. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ac9462ff1c1707daa727573b385eb5be3) |
|   ||
| (void) | - [setAttribute:forKey:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#aa14adc7f025932717271f7ba6d0028fd) |
|   | Sets an arbitrary attribute in the object. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#aa14adc7f025932717271f7ba6d0028fd) |
|   ||
| (NSObject\< NSCoding \> \*__nullable) | - [attributeForKey:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a4dd382d74e97273523fa1de49ad79c5d) |
|   | Looks up an attribute in the object. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a4dd382d74e97273523fa1de49ad79c5d) |
|   ||
| (void) | - [removeAttributeForKey:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a1396e449fb3b1f2e7c8aac9c7c8ef77e) |
|   | Removes an attribute from the object. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a1396e449fb3b1f2e7c8aac9c7c8ef77e) |
|   ||
| (void) | - [removeAllAttributes](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ae346957b96ad7d7d2e1bc4814d54b161) |
|   | Removes all attributes from the object. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ae346957b96ad7d7d2e1bc4814d54b161) |
|   ||

|---|---|
| ## Property Summary ||
| NSString \* | [ipAddress](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a04d0be447e9173a2d2dc691d8bcdbcfe) |
|   | The device's IPv4 address, in dot-notation. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a04d0be447e9173a2d2dc691d8bcdbcfe) |
|   ||
| uint16_t | [servicePort](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#aa456b21cc2b7d68a8e27522690fe165c) |
|   | The device's service port. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#aa456b21cc2b7d68a8e27522690fe165c) |
|   ||
| NSString \* | [deviceID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ac573fca7dfbb317bad4095a25435948e) |
|   | A unique identifier for the device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ac573fca7dfbb317bad4095a25435948e) |
|   ||
| NSString \* | [friendlyName](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a3de90f6a33ae5776e33ec631dee3893d) |
|   | The device's friendly name. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a3de90f6a33ae5776e33ec631dee3893d) |
|   ||
| NSString \* | [manufacturer](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ac0a9b41205df408a03caf77d0614ed2a) |
|   | The device's manufacturer name. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ac0a9b41205df408a03caf77d0614ed2a) |
|   ||
| NSString \* | [modelName](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a9a64928b2032f1fde08bca3c94d64b31) |
|   | The device's model name. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a9a64928b2032f1fde08bca3c94d64b31) |
|   ||
| NSArray\< [GCKImage](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_image) \* \> \* | [icons](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ae379b4a588045efc0b4876690df3c2d0) |
|   | An array of [GCKImage](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_image "A class that represents an image that is located on a web server. ") objects containing icons for the device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ae379b4a588045efc0b4876690df3c2d0) |
|   ||
| [GCKDeviceStatus](https://developers.google.com/cast/v3/reference/ios/g_c_k_device_8h#a3548fc43f966ad0b6b3741aff9de6d02) | [status](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a157857aac29f66747bdaa1685528ab0a) |
|   | The device's status at the time that it was most recently scanned. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a157857aac29f66747bdaa1685528ab0a) |
|   ||
| NSString \* | [statusText](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a72417f177891bb6e996640a1761067bb) |
|   | The status text reported by the currently running receiver application, if any. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a72417f177891bb6e996640a1761067bb) |
|   ||
| NSString \* | [deviceVersion](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a83f2cf55f6c81efc81c8ce7c971033f5) |
|   | The device's protocol version. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a83f2cf55f6c81efc81c8ce7c971033f5) |
|   ||
| BOOL | [isOnLocalNetwork](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ad1091e0d9e8c797d420db154dbcf6af7) |
|   | YES if this device is on the local network. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ad1091e0d9e8c797d420db154dbcf6af7) |
|   ||
| [GCKDeviceType](https://developers.google.com/cast/v3/reference/ios/g_c_k_device_8h#a82782e5a6bc6438a8ced1268162a109e) | [type](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a17c45ad2e3cb0e865286b302dc8c5642) |
|   | The device type. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a17c45ad2e3cb0e865286b302dc8c5642) |
|   ||
| NSString \* | [category](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#adc674458ad7067329a196626df519189) |
|   | The device category, a string that uniquely identifies the type of device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#adc674458ad7067329a196626df519189) |
|   ||
| NSString \* | [uniqueID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a7c834d64a3c55ba90666ee334c7e2071) |
|   | A globally unique ID for this device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#a7c834d64a3c55ba90666ee334c7e2071) |
|   ||

## Method Detail

|---|---|---|---|---|
| - (BOOL) isSameDeviceAs: |   | (const [GCKDevice](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device) \*) | *other* |   |

Tests if this device refers to the same physical device as another.

Returns `YES` if both [GCKDevice](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device "An object representing a receiver device. ") objects have the same category, device ID, IP address, service port, and protocol version.

|---|---|---|---|---|
| - (BOOL) hasCapabilities: |   | (NSInteger) | *deviceCapabilities* |   |

Returns `YES` if the device supports the given capabilities.

Parameters
:

    |---|---|
    | deviceCapabilities | A bitwise-OR of one or more of the [GCKDeviceCapability](https://developers.google.com/cast/v3/reference/ios/g_c_k_device_8h#ae2ffa3f773ebe280518aaa5bca69ebdc) constants. |


|---|---|---|---|
| - (void) setAttribute: |   | (NSObject\< NSCoding \> \*) | *attribute* |
| forKey: |   | (NSString \*) | *key* |
|   |   |   |   |

Sets an arbitrary attribute in the object.

May be used by custom device providers to store device-specific information for non-Cast devices.

Parameters
:

    |---|---|
    | attribute | The attribute value, which must be key-value coding compliant, and cannot be `nil`. |
    | key | The key that identifies the attribute. The key is an arbitrary string. It cannot be `nil`. |


|---|---|---|---|---|
| - (NSObject\<NSCoding\> \* __nullable) attributeForKey: |   | (NSString \*) | *key* |   |

Looks up an attribute in the object.

Parameters
:

    |---|---|
    | key | The key that identifies the attribute. The key is an arbitrary string. It cannot be `nil`. |


Returns
:   The value of the attribute, or `nil` if no such attribute exists.

|---|---|---|---|---|
| - (void) removeAttributeForKey: |   | (NSString \*) | *key* |   |

Removes an attribute from the object.

Parameters
:

    |---|---|
    | key | The key that identifies the attribute. The key is an arbitrary string. It cannot be `nil`. |


|---|---|---|---|
| - (void) removeAllAttributes |   |   |   |

Removes all attributes from the object.

## Property Detail

|---|---|
| |---| | - (NSString\*) ipAddress | | readnonatomiccopy |

The device's IPv4 address, in dot-notation.

Used when making network requests.

|---|---|
| |---| | - (uint16_t) servicePort | | readnonatomicassign |

The device's service port.

|---|---|
| |---| | - (NSString\*) deviceID | | readnonatomiccopy |

A unique identifier for the device.

|---|---|
| |---| | - (NSString\*) friendlyName | | readwritenonatomiccopy |

The device's friendly name.

This is a user-assignable name such as "Living Room".

|---|---|
| |---| | - (NSString\*) manufacturer | | readwritenonatomiccopy |

The device's manufacturer name.

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000007)**
:   Use the modelName or custom attributes instead.

|---|---|
| |---| | - (NSString\*) modelName | | readwritenonatomiccopy |

The device's model name.

|---|---|
| |---| | - (NSArray\<[GCKImage](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_image) \*\>\*) icons | | readwritenonatomiccopy |

An array of [GCKImage](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_image "A class that represents an image that is located on a web server. ") objects containing icons for the device.

|---|---|
| |---| | - ([GCKDeviceStatus](https://developers.google.com/cast/v3/reference/ios/g_c_k_device_8h#a3548fc43f966ad0b6b3741aff9de6d02)) status | | readwritenonatomicassign |

The device's status at the time that it was most recently scanned.

|---|---|
| |---| | - (NSString\*) statusText | | readwritenonatomiccopy |

The status text reported by the currently running receiver application, if any.

|---|---|
| |---| | - (NSString\*) deviceVersion | | readwritenonatomiccopy |

The device's protocol version.

|---|---|
| |---| | - (BOOL) isOnLocalNetwork | | readnonatomicassign |

YES if this device is on the local network.

|---|---|
| |---| | - ([GCKDeviceType](https://developers.google.com/cast/v3/reference/ios/g_c_k_device_8h#a82782e5a6bc6438a8ced1268162a109e)) type | | readnonatomicassign |

The device type.

Since
:   3.3

|---|---|
| |---| | - (NSString\*) category | | readnonatomiccopy |

The device category, a string that uniquely identifies the type of device.

Cast devices have a category of [kGCKCastDeviceCategory](https://developers.google.com/cast/v3/reference/ios/g_c_k_device_8h#aeff3718b2baa2a0f541b3296c5469d47).

|---|---|
| |---| | - (NSString\*) uniqueID | | readnonatomiccopy |

A globally unique ID for this device.

This is a concatenation of the [category](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#adc674458ad7067329a196626df519189) and [deviceID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device#ac573fca7dfbb317bad4095a25435948e) properties.