# GCKDeviceManager Class

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

## Overview

A controller for Cast devices.

This class can send messages to, receive messages from, launch, and close applications running on a Cast device.

The [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager "A controller for Cast devices. ") instance must stay in scope as long as a connection to the Cast device is established or is in the process of being created or torn down. It is safe to release the object before a connection has been started with [connect (GCKDeviceManager)](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ad8d75c16cb415299c51efdb7a0f8a55b), or after either the [deviceManager:didDisconnectWithError: (GCKDeviceManagerDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_device_manager_delegate-p#a7233a9ca38e1f52b1dd1c71570bc1139 "Called when the connection to the device has been terminated. "), [deviceManager:didSuspendConnectionWithReason: (GCKDeviceManagerDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_device_manager_delegate-p#a5a9bdde1216a28e6fe7b845f286d25db "Called when the connection to the device has been suspended, possibly temporarily. "), or [deviceManager:didFailToConnectWithError: (GCKDeviceManagerDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_device_manager_delegate-p#a07d11720660bd77aa14b811639ea518f "Called when the connection to the device has failed. ") delegate callback has been invoked.

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000008)**
:   Use [GCKSessionManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_session_manager "A class that manages sessions. ") and [GCKCastSession](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_session "A class that manages a Cast session with a receiver device. ") to interact with Cast receivers.

Inherits NSObject.

|---|---|
| ## Instance Method Summary ||
| (instancetype) | - [initWithDevice:clientPackageName:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a58d192f95c95d35ef4e6b481256c922c) |
|   | Constructs a new [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager "A controller for Cast devices. ") with the given device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a58d192f95c95d35ef4e6b481256c922c) |
|   ||
| (instancetype) | - [initWithDevice:clientPackageName:ignoreAppStateNotifications:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ae22b82741e3511befb8621371d6a93d3) |
|   | Designated initializer. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ae22b82741e3511befb8621371d6a93d3) |
|   ||
| (void) | - [connect](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ad8d75c16cb415299c51efdb7a0f8a55b) |
|   | Connects to the device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ad8d75c16cb415299c51efdb7a0f8a55b) |
|   ||
| (void) | - [disconnect](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a63072bbcf92b3cbdd1edc1e0afffab87) |
|   | Disconnects from the device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a63072bbcf92b3cbdd1edc1e0afffab87) |
|   ||
| (void) | - [disconnectWithLeave:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#afaddba3b00a74186914424ca018320ad) |
|   | Disconnects from the device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#afaddba3b00a74186914424ca018320ad) |
|   ||
| (BOOL) | - [addChannel:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a220264ca2383ea92b0887f30392e8124) |
|   | Adds a channel which can send and receive messages for this device on a particular namespace. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a220264ca2383ea92b0887f30392e8124) |
|   ||
| (BOOL) | - [removeChannel:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#affec749e345cdce4ac1947cd6372e1cb) |
|   | Removes a previously added channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#affec749e345cdce4ac1947cd6372e1cb) |
|   ||
| (NSInteger) | - [launchApplication:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ab609d875c3e4d96f37e1ee219f1ecef2) |
|   | Launches an application. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ab609d875c3e4d96f37e1ee219f1ecef2) |
|   ||
| (NSInteger) | - [launchApplication:withLaunchOptions:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a8901aae563b841412fce83312e6a40c6) |
|   | Launches an application using the given launch options. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a8901aae563b841412fce83312e6a40c6) |
|   ||
| (NSInteger) | - [launchApplication:relaunchIfRunning:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ad8a1a018ff331488aa24bbe7e784257f) |
|   | Launches an application, optionally relaunching it if it is already running. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ad8a1a018ff331488aa24bbe7e784257f) |
|   ||
| (NSInteger) | - [joinApplication:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ac1f528fd5984b3aa9aec0254c75dfb50) |
|   | Joins an application. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ac1f528fd5984b3aa9aec0254c75dfb50) |
|   ||
| (NSInteger) | - [joinApplication:sessionID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ad282bf5957cd3f01240c8ffeb04dbc45) |
|   | Joins an application with a particular application session ID. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ad282bf5957cd3f01240c8ffeb04dbc45) |
|   ||
| (BOOL) | - [leaveApplication](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ac87b0733c64f0750f9ae205e55227712) |
|   | Leaves the current application. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ac87b0733c64f0750f9ae205e55227712) |
|   ||
| (NSInteger) | - [stopApplication](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a9a280fe727f454f66c73a4c44f92182a) |
|   | Stops any running application(s). [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a9a280fe727f454f66c73a4c44f92182a) |
|   ||
| (NSInteger) | - [stopApplicationWithSessionID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a1d4b6e129ed3a42174e97e0bd5ff21dd) |
|   | Stops the application with the given application session ID. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a1d4b6e129ed3a42174e97e0bd5ff21dd) |
|   ||
| (NSInteger) | - [setVolume:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a73a6ca48adadfc552d85628a4b2c47ad) |
|   | Sets the system volume. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a73a6ca48adadfc552d85628a4b2c47ad) |
|   ||
| (NSInteger) | - [setMuted:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a0595df6d82cd3ac205965e11e02f4249) |
|   | Turns muting on or off. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a0595df6d82cd3ac205965e11e02f4249) |
|   ||
| (NSInteger) | - [requestDeviceStatus](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ac8e63dc9a4622a7e33eccd810129c134) |
|   | Requests the device's current status. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ac8e63dc9a4622a7e33eccd810129c134) |
|   ||

|---|---|
| ## Property Summary ||
| BOOL | [ignoreAppStateNotifications](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ae78eea47e62f446e5a1b23b095be5fe0) |
|   | Whether this object will listen for app state notifications. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ae78eea47e62f446e5a1b23b095be5fe0) |
|   ||
| [GCKConnectionState](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aeb91bcb8e8dc2ae918494213cb33426c) | [connectionState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a4af756d7f86e44089f2fe1d48e2a7a40) |
|   | The device manager's current connection state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a4af756d7f86e44089f2fe1d48e2a7a40) |
|   ||
| [GCKConnectionState](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aeb91bcb8e8dc2ae918494213cb33426c) | [applicationConnectionState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a4cfabbe8dbabbc28f1b93c0b4c5f8405) |
|   | The device manager's current application connection state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a4cfabbe8dbabbc28f1b93c0b4c5f8405) |
|   ||
| BOOL | [isConnected](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a60a0722e711af54394793b8921704267) |
|   | True if the device manager has established a connection to the device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a60a0722e711af54394793b8921704267) |
|   ||
| BOOL | [isConnectedToApp](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#aa6110e2b42b30a3f3dbbdde5225eb709) |
|   | True if the device manager has established a connection to an application on the device. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#aa6110e2b42b30a3f3dbbdde5225eb709) |
|   ||
| BOOL | [isReconnecting](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a78ed81f7d6a8ccee0bd37e5cfac1e430) |
|   | True if the device manager is disconnected due to a potentially transient event (for example, the app is backgrounded, or there was a network error which might be solved by reconnecting). [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a78ed81f7d6a8ccee0bd37e5cfac1e430) |
|   ||
| NSTimeInterval | [reconnectTimeout](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a4482ef37e6c4c47e658fc437beb356e2) |
|   | Reconnection will be attempted for this long in the event that the socket disconnects with a potentially transient error. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a4482ef37e6c4c47e658fc437beb356e2) |
|   ||
| [GCKDevice](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device) \* | [device](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a684f489ffd37b07a109de05d77be3bfe) |
|   | The device that is being controlled by this [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager "A controller for Cast devices. "). [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a684f489ffd37b07a109de05d77be3bfe) |
|   ||
| id\< [GCKDeviceManagerDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_device_manager_delegate-p) \> | [delegate](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a9a83017cc30d3ca16543ea731ab01ae4) |
|   | The delegate for receiving notifications from the [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager "A controller for Cast devices. "). [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a9a83017cc30d3ca16543ea731ab01ae4) |
|   ||
| float | [deviceVolume](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a6da46d362ce944bf0a9682bbc8466440) |
|   | The current volume of the device in the range \[0.0, 1.0\], if known; otherwise 0. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a6da46d362ce944bf0a9682bbc8466440) |
|   ||
| BOOL | [deviceMuted](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#afab195c498b8f95e1dcbf663578829aa) |
|   | The current mute state of the device, if known; otherwise `NO`. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#afab195c498b8f95e1dcbf663578829aa) |
|   ||
| [GCKActiveInputStatus](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#a4e1d6d2f711f543c3bb3ea38807322fa) | [activeInputStatus](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#af15674e34365fb6cc40b29e54f5d5592) |
|   | The device's current "active input" status. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#af15674e34365fb6cc40b29e54f5d5592) |
|   ||
| [GCKStandbyStatus](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#a0b2d49eee120006431d7701487917932) | [standbyStatus](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#aba8844e142480cb18b78a017feeefe3d) |
|   | The device's current "standby" status. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#aba8844e142480cb18b78a017feeefe3d) |
|   ||
| NSString \* | [applicationSessionID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a1e97a0b1716891ba49962c7526d7c819) |
|   | The application session ID for the currently connected receiver application, if any; otherwise `nil`. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a1e97a0b1716891ba49962c7526d7c819) |
|   ||
| [GCKApplicationMetadata](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_application_metadata) \* | [applicationMetadata](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a2e12e6fb91e0e79d5841114894e0d855) |
|   | The metadata for the receiver application that is currently running on the receiver, if any; otherwise `nil`. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a2e12e6fb91e0e79d5841114894e0d855) |
|   ||
| NSString \* | [applicationStatusText](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a1818d3309839cbf2e9f30f593733da35) |
|   | The most recently reported status text from the currently running receiver application, if any; otherwise `nil`. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a1818d3309839cbf2e9f30f593733da35) |
|   ||

## Method Detail

|---|---|---|---|
| - (instancetype) initWithDevice: |   | ([GCKDevice](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device) \*) | *device* |
| clientPackageName: |   | (NSString \*) | *clientPackageName* |
|   |   |   |   |

Constructs a new [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager "A controller for Cast devices. ") with the given device.

The object will listen for app state notifications, and will automatically disconnect from the device when the app goes into the background and attempt to reconnect to the device when the app returns to the foreground.

Parameters
:

    |---|---|
    | device | The device to control. |
    | clientPackageName | The client package name. |


|---|---|---|---|
| - (instancetype) initWithDevice: |   | ([GCKDevice](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device) \*) | *device* |
| clientPackageName: |   | (NSString \*) | *clientPackageName* |
| ignoreAppStateNotifications: |   | (BOOL) | *ignoreAppStateNotifications* |
|   |   |   |   |

Designated initializer.

Constructs a new [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager "A controller for Cast devices. ") for controlling the given device.

If [ignoreAppStateNotifications](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ae78eea47e62f446e5a1b23b095be5fe0) is `NO`, the object will listen for changes to the app state and will automatically disconnect from the device when the app goes into the background and attempt to reconnect to the device when the app returns to the foreground.

If [ignoreAppStateNotifications](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ae78eea47e62f446e5a1b23b095be5fe0) is `YES`, the object will not listen for these notifications, and it will be the app's responsibility to manage the connection lifecycle. Note that in general, a backgrounded iOS app cannot continue running indefinitely, and its active network connections will eventually be closed by the operating system.

Parameters
:

    |---|---|
    | device | The device to control. |
    | clientPackageName | The client package name. |
    | ignoreAppStateNotifications | Whether this object will ignore app state notifications. |


|---|---|---|---|
| - (void) connect |   |   |   |

Connects to the device.

|---|---|---|---|
| - (void) disconnect |   |   |   |

Disconnects from the device.

This is an explicit disconnect.

One of the disconnect methods **must** be called at some point after [connect](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ad8d75c16cb415299c51efdb7a0f8a55b) was called and before this object is released by its owner.

|---|---|---|---|---|
| - (void) disconnectWithLeave: |   | (BOOL) | *leaveApplication* |   |

Disconnects from the device.

One of the disconnect methods **must** be called at some point after [connect](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ad8d75c16cb415299c51efdb7a0f8a55b) was called and before this object is released by its owner.

Parameters
:

    |---|---|
    | leaveApplication | `YES` if this is an explicit disconnect that should disconnect from ("leave") the receiver application before closing the connection; `NO` if this is an implicit disconnect that should just close the connection. |


|---|---|---|---|---|
| - (BOOL) addChannel: |   | ([GCKCastChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel) \*) | *channel* |   |

Adds a channel which can send and receive messages for this device on a particular namespace.

Parameters
:

    |---|---|
    | channel | The channel. |


Returns
:   `YES` if the channel was added, `NO` if it was not added because there was already a channel attached for that namespace.

|---|---|---|---|---|
| - (BOOL) removeChannel: |   | ([GCKCastChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel) \*) | *channel* |   |

Removes a previously added channel.

Parameters
:

    |---|---|
    | channel | The channel. |


Returns
:   `YES` if the channel was removed, `NO` if it was not removed because the given channel was not previously attached.

|---|---|---|---|---|
| - (NSInteger) launchApplication: |   | (NSString \*) | *applicationID* |   |

Launches an application.

Parameters
:

    |---|---|
    | applicationID | The application ID. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the request could not be sent.

|---|---|---|---|
| - (NSInteger) [launchApplication:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ab609d875c3e4d96f37e1ee219f1ecef2) |   | (NSString \*) | *applicationID* |
| withLaunchOptions: |   | ([GCKLaunchOptions](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_launch_options) \*__nullable) | *launchOptions* |
|   |   |   |   |

Launches an application using the given launch options.

Parameters
:

    |---|---|
    | applicationID | The application ID. |
    | launchOptions | The launch options for this request. If `nil`, defaults will be used. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the request could not be sent.

|---|---|---|---|
| - (NSInteger) [launchApplication:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ab609d875c3e4d96f37e1ee219f1ecef2) |   | (NSString \*) | *applicationID* |
| relaunchIfRunning: |   | (BOOL) | *relaunchIfRunning* |
|   |   |   |   |

Launches an application, optionally relaunching it if it is already running.

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000011)**
:   Use [launchApplication:withLaunchOptions:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a8901aae563b841412fce83312e6a40c6) instead.

Parameters
:

    |---|---|
    | applicationID | The application ID. |
    | relaunchIfRunning | If `YES`, relaunches the application if it is already running instead of joining the running application. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the request could not be sent.

|---|---|---|---|---|
| - (NSInteger) joinApplication: |   | (NSString \*__nullable) | *applicationID* |   |

Joins an application.

Parameters
:

    |---|---|
    | applicationID | The application ID. If `nil`, attempts to join whichever application is currently running; otherwise, attempts to join the specified application. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the request could not be sent.

|---|---|---|---|
| - (NSInteger) [joinApplication:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#ac1f528fd5984b3aa9aec0254c75dfb50) |   | (NSString \*) | *applicationID* |
| sessionID: |   | (NSString \*) | *sessionID* |
|   |   |   |   |

Joins an application with a particular application session ID.

The request will fail if the given session ID is no longer active on the receiver.

Parameters
:

    |---|---|
    | applicationID | The application ID. |
    | sessionID | The application session ID. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the request could not be sent.

|---|---|---|---|
| - (BOOL) leaveApplication |   |   |   |

Leaves the current application.

Returns
:   `NO` if the message could not be sent.

|---|---|---|---|
| - (NSInteger) stopApplication |   |   |   |

Stops any running application(s).

Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the request could not be sent.

|---|---|---|---|---|
| - (NSInteger) stopApplicationWithSessionID: |   | (NSString \*__nullable) | *sessionID* |   |

Stops the application with the given application session ID.

The request will fail if the given session ID is no longer active on the receiver.

Parameters
:

    |---|---|
    | sessionID | The application session ID, which may not be `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the request could not be sent.

|---|---|---|---|---|
| - (NSInteger) setVolume: |   | (float) | *volume* |   |

Sets the system volume.

Parameters
:

    |---|---|
    | volume | The new volume, in the range \[0.0, 1.0\]. Out of range values will be silently clipped. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the request could not be sent.

|---|---|---|---|---|
| - (NSInteger) setMuted: |   | (BOOL) | *muted* |   |

Turns muting on or off.

Parameters
:

    |---|---|
    | muted | Whether audio should be muted or unmuted. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the request could not be sent.

|---|---|---|---|
| - (NSInteger) requestDeviceStatus |   |   |   |

Requests the device's current status.

This will result in all of the delegate status update callbacks being invoked once the updated status information is received.

Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the request could not be sent.

## Property Detail

|---|---|
| |---| | - (BOOL) ignoreAppStateNotifications | | readnonatomicassign |

Whether this object will listen for app state notifications.

This flag may be specified in the initializer. The default value is `NO`.

|---|---|
| |---| | - ([GCKConnectionState](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aeb91bcb8e8dc2ae918494213cb33426c)) connectionState | | readnonatomicassign |

The device manager's current connection state.

|---|---|
| |---| | - ([GCKConnectionState](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aeb91bcb8e8dc2ae918494213cb33426c)) applicationConnectionState | | readnonatomicassign |

The device manager's current application connection state.

|---|---|
| |---| | - (BOOL) isConnected | | readnonatomicassign |

True if the device manager has established a connection to the device.

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000009)**
:   Use [connectionState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a4af756d7f86e44089f2fe1d48e2a7a40).

|---|---|
| |---| | - (BOOL) isConnectedToApp | | readnonatomicassign |

True if the device manager has established a connection to an application on the device.

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000010)**
:   Use [applicationConnectionState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager#a4cfabbe8dbabbc28f1b93c0b4c5f8405).

|---|---|
| |---| | - (BOOL) isReconnecting | | readnonatomicassign |

True if the device manager is disconnected due to a potentially transient event (for example, the app is backgrounded, or there was a network error which might be solved by reconnecting).

Note that the disconnection/connection callbacks will not be called while the device manager attemps to reconnect after a potentially transient event, but the properties will always reflect the actual current state and can be observed.

|---|---|
| |---| | - (NSTimeInterval) reconnectTimeout | | readwritenonatomicassign |

Reconnection will be attempted for this long in the event that the socket disconnects with a potentially transient error.

The default timeout is 15 seconds.

|---|---|
| |---| | - ([GCKDevice](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device)\*) device | | readnonatomicassign |

The device that is being controlled by this [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager "A controller for Cast devices. ").

|---|---|
| |---| | - (id\<[GCKDeviceManagerDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_device_manager_delegate-p)\>) delegate | | readwritenonatomicweak |

The delegate for receiving notifications from the [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager "A controller for Cast devices. ").

|---|---|
| |---| | - (float) deviceVolume | | readnonatomicassign |

The current volume of the device in the range \[0.0, 1.0\], if known; otherwise 0.

|---|---|
| |---| | - (BOOL) deviceMuted | | readnonatomicassign |

The current mute state of the device, if known; otherwise `NO`.

|---|---|
| |---| | - ([GCKActiveInputStatus](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#a4e1d6d2f711f543c3bb3ea38807322fa)) activeInputStatus | | readnonatomicassign |

The device's current "active input" status.

|---|---|
| |---| | - ([GCKStandbyStatus](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#a0b2d49eee120006431d7701487917932)) standbyStatus | | readnonatomicassign |

The device's current "standby" status.

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

The application session ID for the currently connected receiver application, if any; otherwise `nil`.

A new, unique session ID is generated whenever a receiver application is launched (including when the same application is relaunched) and remains in effect as long as the receiver application continues running.

|---|---|
| |---| | - ([GCKApplicationMetadata](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_application_metadata)\*) applicationMetadata | | readnonatomiccopy |

The metadata for the receiver application that is currently running on the receiver, if any; otherwise `nil`.

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

The most recently reported status text from the currently running receiver application, if any; otherwise `nil`.