# GCKCastOptions Class

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

## Overview

Options that affect the discovery of Cast devices and the behavior of Cast sessions.

Writable properties must be set before passing this object to the [GCKCastContext](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_context "A class containing global objects and state for the framework. ").

Since
:   3.0

Inherits NSObject. Implements \<NSCopying\>.

|---|---|
| ## Instance Method Summary ||
| (instancetype) | - [initWithReceiverApplicationID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#ac4cf1bfe4b113dd3d44dae054a6eddf6) |
|   | Constructs a new [GCKCastOptions](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options "Options that affect the discovery of Cast devices and the behavior of Cast sessions. ") object with the specified receiver application ID. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#ac4cf1bfe4b113dd3d44dae054a6eddf6) |
|   ||
| (instancetype) | - [initWithSupportedNamespaces:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#a640c2f358caa753be267b144940369f8) |
|   | Constructs a new [GCKCastOptions](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options "Options that affect the discovery of Cast devices and the behavior of Cast sessions. ") object with the specified list of namespaces. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#a640c2f358caa753be267b144940369f8) |
|   ||

|---|---|
| ## Property Summary ||
| BOOL | [physicalVolumeButtonsWillControlDeviceVolume](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#a74d509ff761dda7cf91e05e6e2c2e589) |
|   | A flag indicating whether the sender device's physical volume buttons should control the session's volume. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#a74d509ff761dda7cf91e05e6e2c2e589) |
|   ||
| BOOL | [disableDiscoveryAutostart](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#a6cfeb6f96487fd0e1fc68c31928d3e3d) |
|   | A flag indicating whether the discovery of Cast devices should start automatically at context initialization time. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#a6cfeb6f96487fd0e1fc68c31928d3e3d) |
|   ||
| [GCKLaunchOptions](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_launch_options) \* | [launchOptions](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#a3f84540a9d74390530d6759d8d421d67) |
|   | The receiver launch options to use when starting a Cast session. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#a3f84540a9d74390530d6759d8d421d67) |
|   ||
| NSString \* | [sharedContainerIdentifier](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#ac6afecc80e19cda3508fefcca24552ad) |
|   | The shared container identifier to use for background HTTP downloads that are performed by the framework. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#ac6afecc80e19cda3508fefcca24552ad) |
|   ||
| BOOL | [suspendSessionsWhenBackgrounded](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#a0edf44953049a7d888847745a387c9dc) |
|   | Whether sessions should be suspended when the sender application goes into the background (and resumed when it returns to the foreground). [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options#a0edf44953049a7d888847745a387c9dc) |
|   ||

## Method Detail

|---|---|---|---|---|
| - (instancetype) initWithReceiverApplicationID: |   | (NSString \*) | *applicationID* |   |

Constructs a new [GCKCastOptions](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options "Options that affect the discovery of Cast devices and the behavior of Cast sessions. ") object with the specified receiver application ID.

Parameters
:

    |---|---|
    | applicationID | The ID of the receiver application which must be supported by discovered Cast devices, and which will be launched when starting a new Cast session. |


|---|---|---|---|---|
| - (instancetype) initWithSupportedNamespaces: |   | (NSArray\< NSString \* \> \*) | *namespaces* |   |

Constructs a new [GCKCastOptions](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_options "Options that affect the discovery of Cast devices and the behavior of Cast sessions. ") object with the specified list of namespaces.

Parameters
:

    |---|---|
    | namespaces | A list of namespaces which must be supported by the currently running receiver application on each discovered Cast device. |


## Property Detail

|---|---|
| |---| | - (BOOL) physicalVolumeButtonsWillControlDeviceVolume | | readwritenonatomicassign |

A flag indicating whether the sender device's physical volume buttons should control the session's volume.

|---|---|
| |---| | - (BOOL) disableDiscoveryAutostart | | readwritenonatomicassign |

A flag indicating whether the discovery of Cast devices should start automatically at context initialization time.

If set to `NO`, discovery can be started and stopped on-demand by using the methods [startDiscovery (GCKDiscoveryManager)](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_discovery_manager#a91dde311473c86fc4865d423498b8a2d "Starts the discovery process. ") and [stopDiscovery (GCKDiscoveryManager)](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_discovery_manager#a7ab4287d3ba99588f32689cefe053a15 "Stops the discovery process. ").

Since
:   3.4

|---|---|
| |---| | - ([GCKLaunchOptions](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_launch_options)\*) launchOptions | | readwritenonatomiccopy |

The receiver launch options to use when starting a Cast session.

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

The shared container identifier to use for background HTTP downloads that are performed by the framework.

Since
:   3.2

|---|---|
| |---| | - (BOOL) suspendSessionsWhenBackgrounded | | readwritenonatomicassign |

Whether sessions should be suspended when the sender application goes into the background (and resumed when it returns to the foreground).

By default this option is set to `YES`. It is appropriate to set this to `NO` in applications that are able to maintain network connections indefinitely while in the background.

Since
:   3.4