# GCKCastSession Class

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

## Overview

A class that manages a Cast session with a receiver device.

Sessions are created and managed automatically by the [GCKSessionManager](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session_manager "A class that manages sessions. "). The application should not directly call the session lifecycle methods such as [start (GCKSession(Protected))](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#afb4b46285c3a7520833a3950ff49094e) or [endWithAction: (GCKSession(Protected))](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#a6422c3e31fda277463648e0542a313e5).

Since
:   3.0

Inherits [GCKSession](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session).

|---|---|
| ## Instance Method Summary ||
| (instancetype) | - [initWithDevice:sessionID:sessionOptions:castOptions:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#ac6e411b5fc5777a95858f7ca82c68794) |
|   | Constructs a new Cast session with the given Cast options. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#ac6e411b5fc5777a95858f7ca82c68794) |
|   ||
| (BOOL) | - [addChannel:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a3514b6933a579d4255702375f542c16a) |
|   | Registers a channel with the session. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a3514b6933a579d4255702375f542c16a) |
|   ||
| (BOOL) | - [removeChannel:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a6b8e066d5de391f8c221c731757a05da) |
|   | Removes a previously registered channel from the session. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a6b8e066d5de391f8c221c731757a05da) |
|   ||
| (void) | - [addDeviceStatusListener:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a2fb12dfb77bd7d128c3fbd3873505b0e) |
|   | Adds a [GCKCastDeviceStatusListener](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_cast_device_status_listener-p "A listener protocol for receiving Cast device status change notifications. ") to this object's list of listeners. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a2fb12dfb77bd7d128c3fbd3873505b0e) |
|   ||
| (void) | - [removeDeviceStatusListener:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a34b5e4061f72075ac9d9c51ff83b8f3b) |
|   | Removes a [GCKCastDeviceStatusListener](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_cast_device_status_listener-p "A listener protocol for receiving Cast device status change notifications. ") from this object's list of listeners. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a34b5e4061f72075ac9d9c51ff83b8f3b) |
|   ||
| ([GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request) \*) | - [setDeviceVolume:forMultizoneDevice:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#abe5b8e955ce6b848ae853ea46644fa0d) |
|   | Sets the individual device's volume in a multizone group. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#abe5b8e955ce6b848ae853ea46644fa0d) |
|   ||
| ([GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request) \*) | - [setDeviceMuted:forMultizoneDevice:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a75eecf3f0eed3157aac49c34070a435a) |
|   | Sets the individual device's muted state in a multizone group. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a75eecf3f0eed3157aac49c34070a435a) |
|   ||
| ([GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request) \*) | - [requestMultizoneStatus](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#add8b59116e0535f07164d93d6dd888a2) |
|   | Request multizone status from a multizone group. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#add8b59116e0535f07164d93d6dd888a2) |
|   ||
| (instancetype) | - [initWithDevice:traits:sessionID:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a6b3f944a300a5a524b00667248c2e501) |
|   | Initializes a new session object for the given device, with default options. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a6b3f944a300a5a524b00667248c2e501) |
|   ||
| (instancetype) | - [initWithDevice:traits:sessionID:sessionOptions:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a07941c164c88cb776255d769041641d2) |
|   | Initializes a new session object for the given device. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a07941c164c88cb776255d769041641d2) |
|   ||
| ([GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request) \*) | - [setDeviceVolume:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a68dcca2fdf1f4aebee394f0af56e7fb8) |
|   | Sets the device's volume. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a68dcca2fdf1f4aebee394f0af56e7fb8) |
|   ||
| ([GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request) \*) | - [setDeviceMuted:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#aac1dc4461b6d7ae6f1f5f9dc93cafebd) |
|   | Sets the device's mute state. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#aac1dc4461b6d7ae6f1f5f9dc93cafebd) |
|   ||
| (void) | - [start](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#afb4b46285c3a7520833a3950ff49094e) |
|   | Starts the session. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#afb4b46285c3a7520833a3950ff49094e) |
|   ||
| (void) | - [endWithAction:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a6422c3e31fda277463648e0542a313e5) |
|   | Ends the session with the specified action. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a6422c3e31fda277463648e0542a313e5) |
|   ||
| (void) | - [notifyDidStartWithSessionID:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a1ebed677b93ece4f7049db8bac5985b4) |
|   | Called by subclasses to notify the framework that the session has been started. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a1ebed677b93ece4f7049db8bac5985b4) |
|   ||
| (void) | - [notifyDidFailToStartWithError:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a97935eb165862dda5e182f7c552aad86) |
|   | Called by subclasses to notify the framework that the session has failed to start. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a97935eb165862dda5e182f7c552aad86) |
|   ||
| (void) | - [notifyDidEndWithError:willTryToResume:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a7e7467c9c675d9ef8a04cc3a0eff446f) |
|   | Called by subclasses to notify the framework that the session has ended. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a7e7467c9c675d9ef8a04cc3a0eff446f) |
|   ||
| (void) | - [notifyDidReceiveDeviceVolume:muted:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a67859c55d9f28b889b4f15601ddae9c7) |
|   | Called by subclasses to notify the framework that updated device volume and mute state has been received from the device. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a67859c55d9f28b889b4f15601ddae9c7) |
|   ||
| (void) | - [notifyDidReceiveDeviceStatus:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a0b8183e1c9542c2e5672c5dae4ac6652) |
|   | Called by subclasses to notify the framework that updated status has been received from the device. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a0b8183e1c9542c2e5672c5dae4ac6652) |
|   ||
| (void) | - [notifyDidSuspendWithReason:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a7ae7a64b8cf88d4263da1f72bd6822b6) |
|   | Deprecated, do not use - implemented as a no-op. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a7ae7a64b8cf88d4263da1f72bd6822b6) |
|   ||
| (void) | - [notifyDidResume](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a925cf3de3d0080f5bf5c833b99b1846e) |
|   | Deprecated, do not use - implemented as a no-op. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a925cf3de3d0080f5bf5c833b99b1846e) |
|   ||

|---|---|
| ## Property Summary ||
| GCKActiveInputStatus | [activeInputStatus](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a8cca9b76646eb61944c9a0913f7ff7c9) |
|   | The device's current "active input" status. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a8cca9b76646eb61944c9a0913f7ff7c9) |
|   ||
| GCKStandbyStatus | [standbyStatus](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a04019abd1149c9785c39430b3da8ef6a) |
|   | The device's current "standby" status. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a04019abd1149c9785c39430b3da8ef6a) |
|   ||
| [GCKApplicationMetadata](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_application_metadata) \* | [applicationMetadata](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#aa48324aeb26bd15ec3b7e052138ea48c) |
|   | The metadata for the receiver application that is currently running on the receiver device, if any; otherwise `nil`. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#aa48324aeb26bd15ec3b7e052138ea48c) |
|   ||
| [GCKDevice](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_device) \* | [device](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a30d6130e558b235e37f1cbded2d27ce8) |
|   | The device that this session is associated with. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a30d6130e558b235e37f1cbded2d27ce8) |
|   ||
| NSString \* | [sessionID](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#af77a47f768c15bb8644aed6e75981fd3) |
|   | The current session ID, if any. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#af77a47f768c15bb8644aed6e75981fd3) |
|   ||
| GCKSessionOptions \* | [sessionOptions](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a8c3b1685e8c434b8dc0f5c181028905b) |
|   | The session options, if any. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a8c3b1685e8c434b8dc0f5c181028905b) |
|   ||
| GCKConnectionState | [connectionState](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a15f8c15b38bf0d2f45007166464cf341) |
|   | The current session connection state. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a15f8c15b38bf0d2f45007166464cf341) |
|   ||
| BOOL | [suspended](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#ad6352a0474dc44fb5296b82e7c8cdcf7) |
|   | A flag indicating whether the session is currently suspended. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#ad6352a0474dc44fb5296b82e7c8cdcf7) |
|   ||
| NSString \* | [deviceStatusText](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a1821f77bc0c0dc159419608105483a0a) |
|   | The current device status text. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a1821f77bc0c0dc159419608105483a0a) |
|   ||
| [GCKSessionTraits](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session_traits) \* | [traits](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#ae0633197f2af22762692e3b5bbca4afe) |
|   | The session traits. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#ae0633197f2af22762692e3b5bbca4afe) |
|   ||
| float | [currentDeviceVolume](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#af4120ee98a679c4ed3abc6ba6b59cf12) |
|   | The current device volume, in the range \[0.0, 1.0\]. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#af4120ee98a679c4ed3abc6ba6b59cf12) |
|   ||
| BOOL | [currentDeviceMuted](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a857055ee238f5af0720d83a6f3281449) |
|   | The current device mute state. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a857055ee238f5af0720d83a6f3281449) |
|   ||
| [GCKRemoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_remote_media_client) \* | [remoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a1a8e2db83593db698392d2a7504e7b11) |
|   | The [GCKRemoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_remote_media_client "A class for controlling media playback on a Cast receiver. ") object that can be used to control media playback in this session. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a1a8e2db83593db698392d2a7504e7b11) |
|   ||
| [GCKMediaMetadata](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_metadata) \* | [mediaMetadata](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a8dbb7f0afa3b8ef806e7203278638d4f) |
|   | The current media metadata, if any. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_session#a8dbb7f0afa3b8ef806e7203278638d4f) |
|   ||

## Method Detail

|---|---|---|---|
| - (instancetype) initWithDevice: |   | ([GCKDevice](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_device) \*) | *device* |
| sessionID: |   | (nullable NSString \*) | *sessionID* |
| sessionOptions: |   | (nullable GCKSessionOptions \*) | *sessionOptions* |
| castOptions: |   | ([GCKCastOptions](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_options) \*) | *castOptions* |
|   |   |   |   |

Constructs a new Cast session with the given Cast options.

Parameters
:

    |---|---|
    | device | The receiver device. |
    | sessionID | The session ID, if resuming; otherwise `nil`. |
    | sessionOptions | The session options, if any; otherwise `nil`. |
    | castOptions | The Cast options. |


Since
:   4.0

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

Registers a channel with the session.

If the session is connected and the receiver application supports the channel's namespace, the channel will be automatically connected. If the session is not connected, the channel will remain in a disconnected state until the session is started.

Parameters
:

    |---|---|
    | channel | The channel to register. |


Returns
:   `YES` if the channel was registered successfully, `NO` otherwise.

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

Removes a previously registered channel from the session.

Parameters
:

    |---|---|
    | channel | The channel to unregister. |


Returns
:   `YES` if the channel was unregistered successfully, `NO` otherwise.

|---|---|---|---|---|
| - (void) addDeviceStatusListener: |   | (id\< [GCKCastDeviceStatusListener](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_cast_device_status_listener-p) \>) | *listener* |   |

Adds a [GCKCastDeviceStatusListener](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_cast_device_status_listener-p "A listener protocol for receiving Cast device status change notifications. ") to this object's list of listeners.

The added listener is weakly held, and should be retained to avoid unexpected deallocation.

Parameters
:

    |---|---|
    | listener | The listener to add. |


|---|---|---|---|---|
| - (void) removeDeviceStatusListener: |   | (id\< [GCKCastDeviceStatusListener](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_cast_device_status_listener-p) \>) | *listener* |   |

Removes a [GCKCastDeviceStatusListener](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_cast_device_status_listener-p "A listener protocol for receiving Cast device status change notifications. ") from this object's list of listeners.

Parameters
:

    |---|---|
    | listener | The listener to remove. |


|---|---|---|---|
| - ([GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request) \*) [setDeviceVolume:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#a68dcca2fdf1f4aebee394f0af56e7fb8) |   | (float) | *volume* |
| forMultizoneDevice: |   | ([GCKMultizoneDevice](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_multizone_device) \*) | *device* |
|   |   |   |   |

Sets the individual device's volume in a multizone group.

This is an asynchronous operation.

Parameters
:

    |---|---|
    | volume | The new volume, in the range \[0.0, 1.0\]. |
    | device | The multizone device. |


Returns
:   A [GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request "An object for tracking an asynchronous request. ") object for tracking the request.

|---|---|---|---|
| - ([GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request) \*) [setDeviceMuted:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session#aac1dc4461b6d7ae6f1f5f9dc93cafebd) |   | (BOOL) | *muted* |
| forMultizoneDevice: |   | ([GCKMultizoneDevice](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_multizone_device) \*) | *device* |
|   |   |   |   |

Sets the individual device's muted state in a multizone group.

This is an asynchronous operation.

Parameters
:

    |---|---|
    | muted | The new muted state. |
    | device | The multizone device. |


Returns
:   A [GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request "An object for tracking an asynchronous request. ") object for tracking the request.

|---|---|---|---|
| - ([GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request) \*) requestMultizoneStatus |   |   |   |

Request multizone status from a multizone group.

This is an asynchronous operation. When the multizone status is received, the [castSession:didReceiveMultizoneStatus: (GCKCastDeviceStatusListener-p)](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_cast_device_status_listener-p#adf01520b37c71ffc030aa53edb3cc554 "Called when the Cast device's multizone status has changed. ") delegate method will be messaged.

Returns
:   A [GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request "An object for tracking an asynchronous request. ") object for tracking the request.

|---|---|---|---|
| - (instancetype) initWithDevice: |   | ([GCKDevice](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_device) \*) | *device* |
| traits: |   | (nullable [GCKSessionTraits](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session_traits) \*) | *traits* |
| sessionID: |   | (nullable NSString \*) | *sessionID* |
|   |   |   |   |

Initializes a new session object for the given device, with default options.

Parameters
:

    |---|---|
    | device | The device. |
    | traits | The session traits. |
    | sessionID | The session ID of an existing session, if this object will be used to resume a session; otherwise `nil` if it will be used to start a new session. |


|---|---|---|---|
| - (instancetype) initWithDevice: |   | ([GCKDevice](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_device) \*) | *device* |
| traits: |   | (nullable [GCKSessionTraits](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session_traits) \*) | *traits* |
| sessionID: |   | (nullable NSString \*) | *sessionID* |
| sessionOptions: |   | (nullable GCKSessionOptions \*) | *sessionOptions* |
|   |   |   |   |

Initializes a new session object for the given device.

Parameters
:

    |---|---|
    | device | The device. |
    | traits | The session traits. |
    | sessionID | The session ID of an existing session, if this object will be used to resume a session; otherwise `nil` if it will be used to start a new session. |
    | sessionOptions | The session options, if any; otherwise `nil`. |


Since
:   4.0

|---|---|---|---|---|
| - ([GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request) \*) setDeviceVolume: |   | (float) | *volume* |   |

Sets the device's volume.

This is an asynchronous operation. The default implementation is a no-op that fails the request with a GCKErrorCodeUnsupportedFeature error.

Parameters
:

    |---|---|
    | volume | The new volume. |


Returns
:   A [GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request "An object for tracking an asynchronous request. ") object for tracking the request.

Since
:   3.4; in previous framework versions, this method returned `void`.

|---|---|---|---|---|
| - ([GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request) \*) setDeviceMuted: |   | (BOOL) | *muted* |   |

Sets the device's mute state.

This is an asynchronous operation. The default implementation is a no-op that fails the request with a GCKErrorCodeUnsupportedFeature error.

Parameters
:

    |---|---|
    | muted | The new mute state. |


Returns
:   A [GCKRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_request "An object for tracking an asynchronous request. ") object for tracking the request.

Since
:   3.4; in previous framework versions, this method returned `void`.

|---|---|---|---|
| - (void) start |   |   |   |

Starts the session.

This is an asynchronous operation. Must be overridden by subclasses.

Provided by category [GCKSession(Protected)](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#afb4b46285c3a7520833a3950ff49094e).

|---|---|---|---|---|
| - (void) endWithAction: |   | ([GCKSessionEndAction](https://developers.google.com/cast/docs/reference/ios/g_c_k_session_09_protected_8h#a8b2ec2c03fb85ca2f7541cfebadb96cf)) | *action* |   |

Ends the session with the specified action.

This is an asynchronous operation. Must be overridden by subclasses.

Parameters
:

    |---|---|
    | action | The action to take when ending the session; see GCKSessionEndAction for more details. |


Provided by category [GCKSession(Protected)](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#a6422c3e31fda277463648e0542a313e5).

|---|---|---|---|---|
| - (void) notifyDidStartWithSessionID: |   | (NSString \*) | *sessionID* |   |

Called by subclasses to notify the framework that the session has been started.

Parameters
:

    |---|---|
    | sessionID | The session's unique ID. |


Provided by category [GCKSession(Protected)](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#a1ebed677b93ece4f7049db8bac5985b4).

|---|---|---|---|---|
| - (void) notifyDidFailToStartWithError: |   | ([GCKError](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_error) \*) | *error* |   |

Called by subclasses to notify the framework that the session has failed to start.

Parameters
:

    |---|---|
    | error | The error that occurred. |


Provided by category [GCKSession(Protected)](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#a97935eb165862dda5e182f7c552aad86).

|---|---|---|---|
| - (void) notifyDidEndWithError: |   | (nullable NSError \*) | *error* |
| willTryToResume: |   | (BOOL) | *willTryToResume* |
|   |   |   |   |

Called by subclasses to notify the framework that the session has ended.

Parameters
:

    |---|---|
    | error | The error that caused the session to end, if any. Should be `nil` if the session was ended intentionally. |
    | willTryToResume | Whether the session will try to resume itself automatically. |


Provided by category [GCKSession(Protected)](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#a7e7467c9c675d9ef8a04cc3a0eff446f).

|---|---|---|---|
| - (void) notifyDidReceiveDeviceVolume: |   | (float) | *volume* |
| muted: |   | (BOOL) | *muted* |
|   |   |   |   |

Called by subclasses to notify the framework that updated device volume and mute state has been received from the device.

Parameters
:

    |---|---|
    | volume | The device's current volume. Must be in the range \[0, 1.0\]; |
    | muted | The device's current mute state. |


Provided by category [GCKSession(Protected)](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#a67859c55d9f28b889b4f15601ddae9c7).

|---|---|---|---|---|
| - (void) notifyDidReceiveDeviceStatus: |   | (nullable NSString \*) | *statusText* |   |

Called by subclasses to notify the framework that updated status has been received from the device.

Parameters
:

    |---|---|
    | statusText | The new status. |


Provided by category [GCKSession(Protected)](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#a0b8183e1c9542c2e5672c5dae4ac6652).

|---|---|---|---|---|
| - (void) notifyDidSuspendWithReason: |   | ([GCKConnectionSuspendReason](https://developers.google.com/cast/docs/reference/ios/g_c_k_common_8h#a9ac76146a1ad598bb34070e314876a37)) | *reason* |   |

Deprecated, do not use - implemented as a no-op.

**[Deprecated:](https://developers.google.com/cast/docs/reference/ios/deprecated#_deprecated000037)**
:   Do not call.

Provided by category [GCKSession(Protected)](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#a7ae7a64b8cf88d4263da1f72bd6822b6).

|---|---|---|---|
| - (void) notifyDidResume |   |   |   |

Deprecated, do not use - implemented as a no-op.

**[Deprecated:](https://developers.google.com/cast/docs/reference/ios/deprecated#_deprecated000038)**
:   Do not call.

Provided by category [GCKSession(Protected)](https://developers.google.com/cast/docs/reference/ios/category_g_c_k_session_07_protected_08#a925cf3de3d0080f5bf5c833b99b1846e).

## Property Detail

|---|---|
| |---| | - (GCKActiveInputStatus) activeInputStatus | | readnonatomicassign |

The device's current "active input" status.

|---|---|
| |---| | - (GCKStandbyStatus) standbyStatus | | readnonatomicassign |

The device's current "standby" status.

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

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

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

The device that this session is associated with.

|---|---|
| |---| | - (NSString\*) sessionID | | readnonatomiccopyinherited |

The current session ID, if any.

|---|---|
| |---| | - (GCKSessionOptions\*) sessionOptions | | readnonatomicstronginherited |

The session options, if any.

Since
:   4.0

|---|---|
| |---| | - (GCKConnectionState) connectionState | | readnonatomicassigninherited |

The current session connection state.

|---|---|
| |---| | - (BOOL) suspended | | readnonatomicassigninherited |

A flag indicating whether the session is currently suspended.

**[Deprecated:](https://developers.google.com/cast/docs/reference/ios/deprecated#_deprecated000036)**
:   [GCKSession](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session "An abstract base class representing a session with a receiver device. ") no longer supports being in suspended state. If needed, move this functionality to a subclass.

|---|---|
| |---| | - (NSString\*) deviceStatusText | | readnonatomiccopyinherited |

The current device status text.

|---|---|
| |---| | - ([GCKSessionTraits](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session_traits)\*) traits | | readnonatomiccopyinherited |

The session traits.

|---|---|
| |---| | - (float) currentDeviceVolume | | readnonatomicassigninherited |

The current device volume, in the range \[0.0, 1.0\].

|---|---|
| |---| | - (BOOL) currentDeviceMuted | | readnonatomicassigninherited |

The current device mute state.

|---|---|
| |---| | - ([GCKRemoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_remote_media_client)\*) remoteMediaClient | | readnonatomicstronginherited |

The [GCKRemoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_remote_media_client "A class for controlling media playback on a Cast receiver. ") object that can be used to control media playback in this session.

It is `nil` before the session has started, or if the session does not support the [GCKRemoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_remote_media_client "A class for controlling media playback on a Cast receiver. ") API. Subclasses which provide a [GCKRemoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_remote_media_client "A class for controlling media playback on a Cast receiver. ") interface must override the getter method.

|---|---|
| |---| | - ([GCKMediaMetadata](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_metadata)\*) mediaMetadata | | readnonatomicstronginherited |

The current media metadata, if any.

Will be `nil` if the session does not support the media namespace or if no media is currently loaded on the receiver.