# GCKGameManagerChannel Class

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

## Overview

A [GCKCastChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel "A virtual communication channel for exchanging messages between a Cast sender and a Cast receiver...") subclass for game control operations.

See [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. ") for the delegate protocol.

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000017)**
:   The Game Manager API is no longer supported and will be removed in a future release.

Inherits [GCKCastChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel).

|---|---|
| ## Instance Method Summary ||
| (instancetype) | - [initWithSessionID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a235993f01b9c21b80419e5a58f1a29fb) |
|   | Designated initializer. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a235993f01b9c21b80419e5a58f1a29fb) |
|   ||
| (instancetype) | - [init](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a925959d8dd686de2bf10d6b84dd4d9a0) |
|   | Default initializer is not available. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a925959d8dd686de2bf10d6b84dd4d9a0) |
|   ||
| (NSInteger) | - [sendPlayerAvailableRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a88189096c08ea2f8078a57f2621d9fb3) |
|   | Sends a request to the receiver to put the last used player on this sender into the [GCKPlayerStateAvailable](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa45be92bf9f623b97cd1451ba70b17fc) state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a88189096c08ea2f8078a57f2621d9fb3) |
|   ||
| (NSInteger) | - [sendPlayerAvailableRequest:playerID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a5f7ccd9cad827dd9359231825c789550) |
|   | Sends a request to the receiver to put the player into the [GCKPlayerStateAvailable](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa45be92bf9f623b97cd1451ba70b17fc) state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a5f7ccd9cad827dd9359231825c789550) |
|   ||
| (NSInteger) | - [sendPlayerReadyRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a3ecbbf34155cc548b434096321bf336c) |
|   | Sends a request to the receiver to put the last used player on this sender into the [GCKPlayerStateReady](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6a67c467391f891b6ca8cf79f1ce10b561) state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a3ecbbf34155cc548b434096321bf336c) |
|   ||
| (NSInteger) | - [sendPlayerReadyRequest:playerID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a132a9cf01e603d57727652b27c559687) |
|   | Sends a request to the receiver to put the player into the [GCKPlayerStateReady](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6a67c467391f891b6ca8cf79f1ce10b561) state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a132a9cf01e603d57727652b27c559687) |
|   ||
| (NSInteger) | - [sendPlayerPlayingRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a4922a60c4eef5ebbe470ad117ce5e1f5) |
|   | Sends a request to the receiver to put the last used player on this sender into the [GCKPlayerStatePlaying](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa01672db33b85b34abc2d7f21518eb1a) state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a4922a60c4eef5ebbe470ad117ce5e1f5) |
|   ||
| (NSInteger) | - [sendPlayerPlayingRequest:playerID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#aade9d8ba0cf15a803be8bd0a4a837aba) |
|   | Sends a request to the receiver to put the player into the [GCKPlayerStatePlaying](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa01672db33b85b34abc2d7f21518eb1a) state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#aade9d8ba0cf15a803be8bd0a4a837aba) |
|   ||
| (NSInteger) | - [sendPlayerIdleRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a3ee318811171b8b2a6c259bd231d3248) |
|   | Sends a request to the receiver to put the last used player on this sender into the [GCKPlayerStateIdle](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6af675a8e49374d9b30e18589adbf4a687) state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a3ee318811171b8b2a6c259bd231d3248) |
|   ||
| (NSInteger) | - [sendPlayerIdleRequest:playerID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a54057a058200df215aac5022f0d0a24b) |
|   | Sends a request to the receiver to put the player into the [GCKPlayerStateIdle](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6af675a8e49374d9b30e18589adbf4a687) state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a54057a058200df215aac5022f0d0a24b) |
|   ||
| (NSInteger) | - [sendPlayerQuitRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a3702b32e3ddcffa73588d592db515193) |
|   | Sends a request to the receiver to put the last used player on this sender into the [GCKPlayerStateQuit](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6ae9105041fba4fc136b2926ad55fab55a) state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a3702b32e3ddcffa73588d592db515193) |
|   ||
| (NSInteger) | - [sendPlayerQuitRequest:playerID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a9f9e4aa43da57965b6a842ba31af10eb) |
|   | Sends a request to the receiver to put the player into the [GCKPlayerStateQuit](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6ae9105041fba4fc136b2926ad55fab55a) state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a9f9e4aa43da57965b6a842ba31af10eb) |
|   ||
| (NSInteger) | - [sendGameRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a97a880601070134b198d98ea567fd078) |
|   | Sends a game-specific message to the receiver. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a97a880601070134b198d98ea567fd078) |
|   ||
| (NSInteger) | - [sendGameRequest:playerID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a1f82feb2c235f358dea79f3ca592523a) |
|   | Sends a game-specific message to the receiver. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a1f82feb2c235f358dea79f3ca592523a) |
|   ||
| (void) | - [sendGameMessage:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a24333ce92fa392755e889bc000ec5b5d) |
|   | Sends a game-specific message to the receiver. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a24333ce92fa392755e889bc000ec5b5d) |
|   ||
| (void) | - [sendGameMessage:playerID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a122f0fdc093ef3724a417ffe8fe3a226) |
|   | Sends a game-specific message to the receiver. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a122f0fdc093ef3724a417ffe8fe3a226) |
|   ||
| (instancetype) | - [initWithNamespace:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a95b4ed119093a3de422528e8bee9b14e) |
|   | Designated initializer. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a95b4ed119093a3de422528e8bee9b14e) |
|   ||
| (void) | - [didReceiveTextMessage:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#ad8d937fc0cfd104f02d7d2951d925cdd) |
|   | Called when a text message has been received on this channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#ad8d937fc0cfd104f02d7d2951d925cdd) |
|   ||
| (BOOL) | - [sendTextMessage:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a536d42cdfb9d56d9ed10c3f75c493985) |
|   | Sends a text message on this channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a536d42cdfb9d56d9ed10c3f75c493985) |
|   ||
| (BOOL) | - [sendTextMessage:error:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a4033e8c0bcfbaf3916d6e38260930c43) |
|   | Sends a text message on this channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a4033e8c0bcfbaf3916d6e38260930c43) |
|   ||
| (NSInteger) | - [generateRequestID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a8c83fab95cb5d463d28a0426dd4d3e17) |
|   | Generates a request ID for a new message. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a8c83fab95cb5d463d28a0426dd4d3e17) |
|   ||
| (NSNumber \*__nullable) | - [generateRequestNumber](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a87356e48d904a3c88f4a05bd077226cb) |
|   | A convenience method which wraps the result of [generateRequestID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a8c83fab95cb5d463d28a0426dd4d3e17) in an [**NSNumber**](https://goo.gl/gY6NGU). [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a87356e48d904a3c88f4a05bd077226cb) |
|   ||
| (void) | - [didConnect](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a82a79e3e3f45509df5d0b6b4296a8529) |
|   | Called when this channel has been connected, indicating that messages can now be exchanged with the Cast device over this channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a82a79e3e3f45509df5d0b6b4296a8529) |
|   ||
| (void) | - [didDisconnect](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a83f1f5750468a8442116610ff3a6a6a9) |
|   | Called when this channel has been disconnected, indicating that messages can no longer be exchanged with the Cast device over this channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a83f1f5750468a8442116610ff3a6a6a9) |
|   ||

|---|---|
| ## Property Summary ||
| id\< [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p) \> | [delegate](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a6aaa79abe459e612b3b1cf9377183439) |
|   | The delegate for receiving notifications from the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. "). [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a6aaa79abe459e612b3b1cf9377183439) |
|   ||
| [GCKGameManagerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state) \* | [currentState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a7e7e992cbb390bb17a8f073f434dac2d) |
|   | The current state of the game manager. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a7e7e992cbb390bb17a8f073f434dac2d) |
|   ||
| NSString \* | [lastUsedPlayerID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#afc03cdc278bf722ff3601146fd552390) |
|   | The last controllable player ID used in this session. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#afc03cdc278bf722ff3601146fd552390) |
|   ||
| BOOL | [isInitialConnectionEstablished](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a10160b71557e28872f7050a9f27a0ed3) |
|   | Whether this channel is connected with the receiver's Game Manager and we are ready to interact with it. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a10160b71557e28872f7050a9f27a0ed3) |
|   ||
| NSString \* | [protocolNamespace](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#abf91f5de1dfcc467c94d9f711f219625) |
|   | The channel's namespace. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#abf91f5de1dfcc467c94d9f711f219625) |
|   ||
| BOOL | [isConnected](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#aef5eb750a266e9549fd81f45d63b36eb) |
|   | A flag indicating whether this channel is currently connected. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#aef5eb750a266e9549fd81f45d63b36eb) |
|   ||
| [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager) \* | [deviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a31b5b45235120ca70905ee5ac26cd3cf) |
|   | The device manager with which this channel is registered, if any. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a31b5b45235120ca70905ee5ac26cd3cf) |
|   ||

## Method Detail

|---|---|---|---|---|
| - (instancetype) initWithSessionID: |   | (NSString \*) | *castSessionID* |   |

Designated initializer.

Automatically connects to receiver's Game Manager.

Parameters
:

    |---|---|
    | castSessionID | The Session ID corresponding to the currently connected Game Manager. |


|---|---|---|---|
| - (instancetype) init |   |   |   |

Default initializer is not available.

Implements [GCKCastChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a5c30573fc91241959e4ffe894b539d42).

|---|---|---|---|---|
| - (NSInteger) sendPlayerAvailableRequest: |   | (id __nullable) | *extraData* |   |

Sends a request to the receiver to put the last used player on this sender into the [GCKPlayerStateAvailable](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa45be92bf9f623b97cd1451ba70b17fc) state.

If this is not a valid transition for that player an error will be triggered in the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). If there is no last used player, a new player will be registered and its player ID will be set as the last used player ID when the receiver responds to this request. This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

See also
:   [lastUsedPlayerID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#afc03cdc278bf722ff3601146fd552390 "The last controllable player ID used in this session. ")

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `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) [sendPlayerAvailableRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a88189096c08ea2f8078a57f2621d9fb3) |   | (id __nullable) | *extraData* |
| playerID: |   | (NSString \*) | *playerID* |
|   |   |   |   |

Sends a request to the receiver to put the player into the [GCKPlayerStateAvailable](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa45be92bf9f623b97cd1451ba70b17fc) state.

If this is not a valid transition for that player an error will be triggered in the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). If the player ID is `nil` a new player will be registered and its player ID will be set as the last used player ID when the receiver responds to this request. This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |
    | playerID | The player ID of the player whose state is to be changed. |


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) sendPlayerReadyRequest: |   | (id __nullable) | *extraData* |   |

Sends a request to the receiver to put the last used player on this sender into the [GCKPlayerStateReady](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6a67c467391f891b6ca8cf79f1ce10b561) state.

If this is not a valid transition for that player or if there is no last used player ID, an error will be triggered in the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

See also
:   [lastUsedPlayerID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#afc03cdc278bf722ff3601146fd552390 "The last controllable player ID used in this session. ")

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `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) [sendPlayerReadyRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a3ecbbf34155cc548b434096321bf336c) |   | (id __nullable) | *extraData* |
| playerID: |   | (NSString \*) | *playerID* |
|   |   |   |   |

Sends a request to the receiver to put the player into the [GCKPlayerStateReady](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6a67c467391f891b6ca8cf79f1ce10b561) state.

If this is not a valid transition for that player or if there is no last used player ID, an error will be triggered in the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |
    | playerID | The player ID of the player to change the state. |


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) sendPlayerPlayingRequest: |   | (id __nullable) | *extraData* |   |

Sends a request to the receiver to put the last used player on this sender into the [GCKPlayerStatePlaying](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa01672db33b85b34abc2d7f21518eb1a) state.

If this is not a valid transition for that player or if there is no last used player ID, an error will be triggered in the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

See also
:   [lastUsedPlayerID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#afc03cdc278bf722ff3601146fd552390 "The last controllable player ID used in this session. ")

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `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) [sendPlayerPlayingRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a4922a60c4eef5ebbe470ad117ce5e1f5) |   | (id __nullable) | *extraData* |
| playerID: |   | (NSString \*) | *playerID* |
|   |   |   |   |

Sends a request to the receiver to put the player into the [GCKPlayerStatePlaying](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6aa01672db33b85b34abc2d7f21518eb1a) state.

If this is not a valid transition for that player or if there is no last used player ID, an error will be triggered in the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |
    | playerID | The player ID of the player to change the state. |


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) sendPlayerIdleRequest: |   | (id __nullable) | *extraData* |   |

Sends a request to the receiver to put the last used player on this sender into the [GCKPlayerStateIdle](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6af675a8e49374d9b30e18589adbf4a687) state.

If this is not a valid transition for that player or if there is no last used player ID, an error will be triggered in the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). This method should only be called after [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the GCKGameManagerChannel::gameManagerChannel:requestDidFailWithID:error: delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

See also
:   [lastUsedPlayerID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#afc03cdc278bf722ff3601146fd552390 "The last controllable player ID used in this session. ")

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `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) [sendPlayerIdleRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a3ee318811171b8b2a6c259bd231d3248) |   | (id __nullable) | *extraData* |
| playerID: |   | (NSString \*) | *playerID* |
|   |   |   |   |

Sends a request to the receiver to put the player into the [GCKPlayerStateIdle](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6af675a8e49374d9b30e18589adbf4a687) state.

If this is not a valid transition for that player or if there is no last used player ID, an error will be triggered in the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |
    | playerID | The player ID of the player to change the state. |


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) sendPlayerQuitRequest: |   | (id __nullable) | *extraData* |   |

Sends a request to the receiver to put the last used player on this sender into the [GCKPlayerStateQuit](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6ae9105041fba4fc136b2926ad55fab55a) state.

If this is not a valid transition for that player or if there is no last used player ID, an error will be triggered in the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

See also
:   [lastUsedPlayerID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#afc03cdc278bf722ff3601146fd552390 "The last controllable player ID used in this session. ")

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `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) [sendPlayerQuitRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a3702b32e3ddcffa73588d592db515193) |   | (id __nullable) | *extraData* |
| playerID: |   | (NSString \*) | *playerID* |
|   |   |   |   |

Sends a request to the receiver to put the player into the [GCKPlayerStateQuit](https://developers.google.com/cast/v3/reference/ios/g_c_k_player_state_8h#aa9a411f5c852bb7871c5f6584e11f4d6ae9105041fba4fc136b2926ad55fab55a) state.

If this is not a valid transition for that player or if there is no last used player ID, an error will be triggered in the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to receiver's Game Manager.

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |
    | playerID | The player ID of the player to change the state. |


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) sendGameRequest: |   | (id __nullable) | *extraData* |   |

Sends a game-specific message to the receiver.

The message contents are entirely up to the application. The message will originate from [lastUsedPlayerID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#afc03cdc278bf722ff3601146fd552390). The receiver will send a response back to this sender via the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver GameManager.

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `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) [sendGameRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a97a880601070134b198d98ea567fd078) |   | (id __nullable) | *extraData* |
| playerID: |   | (NSString \*) | *playerID* |
|   |   |   |   |

Sends a game-specific message to the receiver.

The message contents are entirely up to the application. The message will originate from `playerID`. If `playerID` is `nil`, [lastUsedPlayerID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#afc03cdc278bf722ff3601146fd552390) will be used. The receiver will send a response back to this sender via the [GCKGameManagerChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p "The GCKGameManagerChannel delegate protocol. "). This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |
    | playerID | The id of the controllable player sending this message. |


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.

|---|---|---|---|---|
| - (void) sendGameMessage: |   | (id __nullable) | *extraData* |   |

Sends a game-specific message to the receiver.

The message contents are entirely up to the application. The message will originate from [lastUsedPlayerID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#afc03cdc278bf722ff3601146fd552390). This is a fire-and-forget method where there's no guarantee that the message has been sent and the receiver won't send a response back to this sender. This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


|---|---|---|---|
| - (void) [sendGameMessage:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a24333ce92fa392755e889bc000ec5b5d) |   | (id __nullable) | *extraData* |
| playerID: |   | (NSString \*) | *playerID* |
|   |   |   |   |

Sends a game-specific message to the receiver.

THe message contents are entirely up to the application. The message will originate from the specified local player ID. This is a fire and forget method where there's no guarantee the message is sent and the receiver won't send a response back to this sender. This method should only be called after the [gameManagerChannelDidConnect: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a0e650e739f7edb7664987e231d56c7f6 "Called when the receiver's Game Manager connects successfully and we are ready to interact with it...") delegate callback has been messaged. Messages the [gameManagerChannel:requestDidFailWithID:error: (GCKGameManagerChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_game_manager_channel_delegate-p#a603e7047041a2397d01652e0c2940cba "Called when a player request or game request failed with an error. ") delegate callback if the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ") is not yet connected to the receiver's Game Manager.

Parameters
:

    |---|---|
    | extraData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |
    | playerID | The ID of the controllable player sending this message. |


|---|---|---|---|---|
| - (instancetype) initWithNamespace: |   | (NSString \*) | *protocolNamespace* |   |

Designated initializer.

Constructs a new [GCKCastChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel "A virtual communication channel for exchanging messages between a Cast sender and a Cast receiver...") with the given namespace.

Parameters
:

    |---|---|
    | protocolNamespace | The namespace. |


Implemented in [GCKGenericChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_generic_channel#ac355b4afa1aa5011122abb8340dea7a0).

|---|---|---|---|---|
| - (void) didReceiveTextMessage: |   | (NSString \*) | *message* |   |

Called when a text message has been received on this channel.

The default implementation is a no-op.

Parameters
:

    |---|---|
    | message | The message. |


|---|---|---|---|---|
| - (BOOL) sendTextMessage: |   | (NSString \*) | *message* |   |

Sends a text message on this channel.

Parameters
:

    |---|---|
    | message | The message. |


Returns
:   `YES` on success or `NO` if the message could not be sent (because the channel is not connected, or because the send buffer is too full at the moment).

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000002)**
:   Use [sendTextMessage:error:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a4033e8c0bcfbaf3916d6e38260930c43) which provides detailed error information.

|---|---|---|---|
| - (BOOL) [sendTextMessage:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a536d42cdfb9d56d9ed10c3f75c493985) |   | (NSString \*) | *message* |
| error: |   | ([GCKError](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_error) \*__nullable \*__nullable) | *error* |
|   |   |   |   |

Sends a text message on this channel.

Parameters
:

    |---|---|
    | message | The message. |
    | error | A pointer at which to store the error result. May be `nil`. |


Returns
:   `YES` on success or `NO` if the message could not be sent.

|---|---|---|---|
| - (NSInteger) generateRequestID |   |   |   |

Generates a request ID for a new message.

Returns
:   The generated ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the channel is not currently connected.

|---|---|---|---|
| - (NSNumber \* __nullable) generateRequestNumber |   |   |   |

A convenience method which wraps the result of [generateRequestID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a8c83fab95cb5d463d28a0426dd4d3e17) in an [**NSNumber**](https://goo.gl/gY6NGU).

Returns
:   The generated ID, or `nil` if the channel is not currently connected.

|---|---|---|---|
| - (void) didConnect |   |   |   |

Called when this channel has been connected, indicating that messages can now be exchanged with the Cast device over this channel.

The default implementation is a no-op.

|---|---|---|---|
| - (void) didDisconnect |   |   |   |

Called when this channel has been disconnected, indicating that messages can no longer be exchanged with the Cast device over this channel.

The default implementation is a no-op.

## Property Detail

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

The delegate for receiving notifications from the [GCKGameManagerChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel "A GCKCastChannel subclass for game control operations. ").

|---|---|
| |---| | - ([GCKGameManagerState](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_state)\*) currentState | | readnonatomicstrong |

The current state of the game manager.

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

The last controllable player ID used in this session.

This can be `nil` if there is no controllable player set up with the receiver.

See also
:   [- sendPlayerAvailableRequest:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_game_manager_channel#a88189096c08ea2f8078a57f2621d9fb3 "Sends a request to the receiver to put the last used player on this sender into the GCKPlayerStateAva...")

|---|---|
| |---| | - (BOOL) isInitialConnectionEstablished | | readnonatomicassign |

Whether this channel is connected with the receiver's Game Manager and we are ready to interact with it.

This method will return `NO` from the point of creation of this channel.

Returns
:   `YES` if this channel is connected to the receiver's Game Manager and ready to interact it; `NO` otherwise.

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

The channel's namespace.

|---|---|
| |---| | - (BOOL) isConnected | | readnonatomicassigninherited |

A flag indicating whether this channel is currently connected.

|---|---|
| |---| | - ([GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager)\*) deviceManager | | readnonatomicweakinherited |

The device manager with which this channel is registered, if any.

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000001)**
:   If this channel was not registered with the deprecated [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager "A controller for Cast devices. ") class, this will be `nil`.