# GCKOpenURLOptions Class

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

## Overview

An object representing options that can be passed to a Cast-enabled application via a deep-link URL.

The source app encodes the Cast-specific options (including the unique ID of the device to cast to, and optionally the session ID of a specific Cast session to join) in a query parameter of the application URL using [asURLQueryItem (GCKOpenURLOptions)](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#aed1ec924900e9ce476887abf06cfc588 "Converts the options into a URL query item. "), and then opens the URL using UIApplication's `-[openURL:options:completionHandler:]` method. The target app extracts the Cast-specific options from the URL it receives in its UIApplicationDelegate's `-[application:openURL:options:]` method by calling [openURLOptionsFromURL: (GCKOpenURLOptions)](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#af755ffd517e47ae816884a564245103a "Extracts the Cast-specific options from the specified URL. "). It then starts or joins a Cast session by passing these options to [startSessionWithOpenURLOptions:sessionOptions: (GCKSessionManager)](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_session_manager#a77bf30ff4579f7c101815d2b2250dc12 "Attempts to join or start a session with options that were supplied to the UIApplicationDelegate::app...").

Since
:   4.0

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

|---|---|
| ## Instance Method Summary ||
| (NSURLQueryItem \*) | - [asURLQueryItem](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#aed1ec924900e9ce476887abf06cfc588) |
|   | Converts the options into a URL query item. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#aed1ec924900e9ce476887abf06cfc588) |
|   ||

|---|---|
| ## Class Method Summary ||
| (nullable [GCKOpenURLOptions](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options) \*) | + [openURLOptionsFromURL:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#af755ffd517e47ae816884a564245103a) |
|   | Extracts the Cast-specific options from the specified URL. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#af755ffd517e47ae816884a564245103a) |
|   ||

|---|---|
| ## Property Summary ||
| NSString \* | [deviceUniqueID](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#a668da1e22bb4f6cc5920525f03d0ff79) |
|   | The unique ID of the device to connect to. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#a668da1e22bb4f6cc5920525f03d0ff79) |
|   ||
| NSString \* | [deviceFriendlyName](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#a54a1b390b84b29d13798270382ccb3cb) |
|   | The friendly name of the device to connect to. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#a54a1b390b84b29d13798270382ccb3cb) |
|   ||
| NSString \* | [sessionID](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#ab797a623e3efe345d25caa3e83046822) |
|   | The session ID of the Cast session to join. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options#ab797a623e3efe345d25caa3e83046822) |
|   ||

## Method Detail

|---|---|---|---|---|
| + (nullable [GCKOpenURLOptions](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_open_u_r_l_options) \*) openURLOptionsFromURL: |   | (NSURL \*) | *url* |   |

Extracts the Cast-specific options from the specified URL.

Returns
:   The extracted options, or `nil` if the URL did not contain any Cast-specific options.

|---|---|---|---|
| - (NSURLQueryItem \*) asURLQueryItem |   |   |   |

Converts the options into a URL query item.

Returns
:   The options as an NSURLQueryItem.

## Property Detail

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

The unique ID of the device to connect to.

Required.

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

The friendly name of the device to connect to.

Optional. This value is not used by the GoogleCast framework, but may be of interest to the receiving application.

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

The session ID of the Cast session to join.

Optional. A value of `nil` indicates that any currently active session should be joined, or if there is none, that a new one should be created.