<GCKDeviceManagerDelegate> 協定

<GCKDeviceManagerDelegate> 通訊協定參考資料

總覽

GCKDeviceManager 委派通訊協定。

除非另有說明,否則呼叫端不應從委派方法中釋放委派 GCKDeviceManager 物件。

繼承自 <NSObjectNSObject>。

執行個體方法摘要

(void) - deviceManagerDidConnect:
 當與裝置建立連線時呼叫。更多...
 
(void) - deviceManager:didFailToConnectWithError:
 連線至裝置失敗時呼叫的方法。更多...
 
(void) - deviceManager:didDisconnectWithError:
 與裝置的連線終止時呼叫。更多...
 
(void) - deviceManager:didSuspendConnectionWithReason:
 Called when the connection to the device has been suspended, possibly temporarily. 更多...
 
(void) - deviceManagerDidResumeConnection:rejoinedApplication:
 Called when a previously suspended device connection has been re-established. 更多...
 
(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

Called when a previously suspended device connection has been re-established.

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.