<GCKDeviceManagerDelegate> 协议

<GCKDeviceManagerDelegate> 协议参考

概览

GCKDeviceManager 委托协议。

除非另有说明,否则调用方不应从委托方法中释放委托 GCKDeviceManager 对象。

继承自 <NSObjectNSObject>。

实例方法摘要

(void) - deviceManagerDidConnect:
 当与设备的连接已建立时调用。更多…
 
(void) - deviceManager:didFailToConnectWithError:
 在与设备的连接失败时调用。更多…
 
(void) - deviceManager:didDisconnectWithError:
 当与设备的连接已终止时调用。更多…
 
(void) - deviceManager:didSuspendConnectionWithReason:
 当与设备的连接已暂停(可能是暂时的)时调用。更多…
 
(void) - deviceManagerDidResumeConnection:rejoinedApplication:
 当之前暂停的设备连接已重新建立时调用。更多…
 
(void) - deviceManager:didConnectToCastApplication:sessionID:launchedApplication:
 在应用已启动或已加入时调用。更多…
 
(void) - deviceManager:didFailToConnectToApplicationWithError:
 在连接到应用失败时调用。更多…
 
(void) - deviceManager:didDisconnectFromApplicationWithError:
 在与当前应用断开连接时调用。更多…
 
(void) - deviceManagerDidStopApplication:
 当停止应用请求成功完成时调用。更多…
 
(void) - deviceManager:didFailToStopApplicationWithError:
 当停止应用请求失败时调用。更多…
 
(void) - deviceManager:didReceiveApplicationMetadata:
 每当当前正在运行的应用的应用元数据发生更改时调用。更多…
 
(void) - deviceManager:didReceiveApplicationStatusText:
 每当当前正在运行的应用状态文本发生变化时调用。更多…
 
(void) - deviceManager:volumeDidChangeToLevel:isMuted:
 每当音量发生变化时调用。更多…
 
(void) - deviceManager:didReceiveActiveInputStatus:
 每当有效输入源状态发生变化时调用。更多…
 
(void) - deviceManager:didReceiveStandbyStatus:
 每当待机状态发生变化时调用。更多…
 
(void) - deviceManager:request:didFailWithError:
 在异步操作失败时调用。更多…
 
(void) - deviceManagerDidPair:withGuestModeDevice:
 当已与设备建立访客模式连接时调用。更多…
 

方法详细信息

- (void) deviceManagerDidConnect: (GCKDeviceManager *)  deviceManager
optional

在与设备建立连接后调用。

Parameters
deviceManagerThe device manager.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didFailToConnectWithError: (NSError *)  error 
optional

在与设备的连接失败时调用。

在此回调中释放 GCKDeviceManager 对象是安全的。

Parameters
deviceManagerThe device manager.
errorThe error that caused the connection to fail.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didDisconnectWithError: (NSError *__nullable)  error 
optional

当与设备的连接已终止时调用。

在此回调中释放 GCKDeviceManager 对象是安全的。

Parameters
deviceManagerThe device manager.
errorThe error that caused the disconnection; nil if there was no error (for example, an intentional disconnect).
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didSuspendConnectionWithReason: (GCKConnectionSuspendReason reason 
optional

当与设备的连接被暂停(可能是暂时的)时调用。

当连接暂停时,设备管理器会在适当的时间自动尝试重新建立连接。通话应用不应尝试自行强制重新连接。

Parameters
deviceManagerThe device manager.
reasonThe reason for the suspension.
- (void) deviceManagerDidResumeConnection: (GCKDeviceManager *)  deviceManager
rejoinedApplication: (BOOL)  rejoinedApplication 
optional

当之前暂停的设备连接已重新建立时调用。

Parameters
deviceManagerThe device manager.
rejoinedApplicationIf a connection had been established to a receiver application at the time of the suspension, this flag indicates whether that application has been successfully re-joined. This value would be NO if, for example, the application was terminated during the time that the device manager was attempting to re-establish its connection to the device.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didConnectToCastApplication: (GCKApplicationMetadata *)  applicationMetadata
sessionID: (NSString *)  sessionID
launchedApplication: (BOOL)  launchedApplication 
optional

在应用已启动或已加入时调用。

Parameters
deviceManagerThe device manager.
applicationMetadataMetadata about the application.
sessionIDThe current application session ID that is active on the receiver.
launchedApplicationYES if the application was launched as part of the connection, or NO if the application was already running and was joined.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didFailToConnectToApplicationWithError: (NSError *)  error 
optional

在连接到应用失败时调用。

Parameters
deviceManagerThe device manager.
errorThe error that caused the failure.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didDisconnectFromApplicationWithError: (NSError *__nullable)  error 
optional

在与当前应用断开连接时调用。

Parameters
deviceManagerThe device manager.
errorThe error that caused the disconnect, or nil if this was a normal disconnect.
- (void) deviceManagerDidStopApplication: (GCKDeviceManager *)  deviceManager
optional

在停止应用请求成功完成后调用。

Parameters
deviceManagerThe device manager.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didFailToStopApplicationWithError: (NSError *)  error 
optional

当停止应用请求失败时调用。

Parameters
deviceManagerThe device manager.
errorThe error that caused the failure.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didReceiveApplicationMetadata: (GCKApplicationMetadata *__nullable)  metadata 
optional

每当当前正在运行的应用的应用元数据发生更改时调用。

Parameters
deviceManagerThe device manager.
metadataThe application metadata. May be nil if no application is currently running.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didReceiveApplicationStatusText: (NSString *__nullable)  applicationStatusText 
optional

每当当前正在运行的应用状态文本发生变化时调用。

Parameters
deviceManagerThe device manager.
applicationStatusTextThe application status text. May be nil if no application is currently running or if the application did not report any status text.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
volumeDidChangeToLevel: (float)  volumeLevel
isMuted: (BOOL)  isMuted 
optional

每当音量发生变化时调用。

Parameters
deviceManagerThe device manager.
volumeLevelThe current device volume level.
isMutedThe current device mute state.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didReceiveActiveInputStatus: (GCKActiveInputStatus activeInputStatus 
optional

每当有效输入源状态发生变化时,系统都会调用此方法。

Parameters
deviceManagerThe device manager.
activeInputStatusThe active input status.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
didReceiveStandbyStatus: (GCKStandbyStatus standbyStatus 
optional

每当待机状态发生变化时,系统都会调用此方法。

Parameters
deviceManagerThe device manager.
standbyStatusThe standby status.
- (void) deviceManager: (GCKDeviceManager *)  deviceManager
request: (NSInteger)  requestID
didFailWithError: (NSError *)  error 
optional

在异步操作失败时调用。

Parameters
deviceManagerThe device manager.
requestIDThe ID of the request that failed.
errorThe error.
- (void) deviceManagerDidPair: (GCKDeviceManager *)  deviceManager
withGuestModeDevice: (GCKDevice *)  guestModeDevice 
optional

当已与设备建立访客模式连接时调用。

Parameters
deviceManagerThe device manager.
guestModeDeviceThe device object for the concrete guest mode device.