AI-generated Key Takeaways
-
GCKGenericChannel is a GCKCastChannel implementation that forwards message and connectivity events to its delegate.
-
It is suitable for use when subclassing is not desired.
-
The class includes methods for sending and receiving text messages and managing connection states.
-
It provides properties to check the connection status and writability of the channel.
Overview
A generic GCKCastChannel implementation, suitable for use when subclassing is not desired.
GCKGenericChannel forwards message and connectivity events to its delegate, and has no processing logic of its own.
See GCKGenericChannelDelegate for the delegate protocol.
Inherits GCKCastChannel .
Method Detail
| - (instancetype) initWithNamespace: | (NSString *) | protocolNamespace |
Designated initializer.
- Parameters
- protocolNamespaceThe namespace for this channel. This namespace must be unique across all channels used by a given application.
Implements GCKCastChannel .
| - (instancetype) init |
Default initializer is not available.
| - (void) didReceiveTextMessage: | (NSString *) | message |
Called when a text message has been received on this channel.
The default implementation is a no-op.
- Parameters
- messageThe message.
| - (BOOL) sendTextMessage: | (NSString *) | message | |
| error: | ( GCKError *_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
-
YESon success orNOif the message could not be sent.
| - (NSInteger) generateRequestID |
Generates a request ID for a new message.
- Returns
- The generated ID, or kGCKInvalidRequestID if the channel is not currently connected.
| - (nullable NSNumber *) generateRequestNumber |
A convenience method which wraps the result of generateRequestID in an NSNumber .
- Returns
- The generated ID, or
nilif 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.
| - (void) didChangeWritableState: | (BOOL) | isWritable |
Called when the writable state of this channel has changed.
The default implementation is a no-op.
- Parameters
- isWritableWhether the channel is now writable.
- Since
- 4.0
Property Detail
The delegate for receiving notifications about changes in the channel's state.
The channel's namespace.
A flag indicating whether this channel is currently connected.
A flag indicating whether this channel is currently writable.
- Since
- 4.0

