Протокол <GCKDeviceManagerDelegate>
Протокол делегата GCKDeviceManager .
Если не указано иное, вызывающая сторона не должна освобождать делегирующий объект GCKDeviceManager из метода делегата.
Наследует <NSObjectNSObject>.
Вызывается при установлении соединения с устройством.
- Parameters
-
deviceManager | The device manager. |
- (void) deviceManager: |
|
( GCKDeviceManager *) |
deviceManager |
didFailToConnectWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Вызывается при сбое подключения к устройству.
Безопасно освобождать объект GCKDeviceManager из этого обратного вызова.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the connection to fail. |
- (void) deviceManager: |
|
( GCKDeviceManager *) |
deviceManager |
didDisconnectWithError: |
|
(NSError *__nullable) |
error |
|
|
| |
|
optional |
Вызывается при разрыве соединения с устройством.
Безопасно освобождать объект GCKDeviceManager из этого обратного вызова.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the disconnection; nil if there was no error (for example, an intentional disconnect). |
Вызывается, когда соединение с устройством было приостановлено, возможно временно.
Когда соединение приостановлено, диспетчер устройств автоматически попытается восстановить соединение в соответствующее время. Вызывающее приложение не должно пытаться принудительно переподключиться самостоятельно.
- Parameters
-
deviceManager | The device manager. |
reason | The reason for the suspension. |
- (void) deviceManagerDidResumeConnection: |
|
( GCKDeviceManager *) |
deviceManager |
rejoinedApplication: |
|
(BOOL) |
rejoinedApplication |
|
|
| |
|
optional |
Вызывается при восстановлении ранее приостановленного соединения с устройством.
- Parameters
-
deviceManager | The device manager. |
rejoinedApplication | If 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
-
deviceManager | The device manager. |
applicationMetadata | Metadata about the application. |
sessionID | The current application session ID that is active on the receiver. |
launchedApplication | YES 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
-
deviceManager | The device manager. |
error | The error that caused the failure. |
- (void) deviceManager: |
|
( GCKDeviceManager *) |
deviceManager |
didDisconnectFromApplicationWithError: |
|
(NSError *__nullable) |
error |
|
|
| |
|
optional |
Вызывается при отключении от текущего приложения.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the disconnect, or nil if this was a normal disconnect. |
Вызывается после успешного завершения запроса на остановку приложения.
- Parameters
-
deviceManager | The device manager. |
- (void) deviceManager: |
|
( GCKDeviceManager *) |
deviceManager |
didFailToStopApplicationWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Вызывается при сбое запроса на остановку приложения.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the failure. |
Вызывается всякий раз, когда метаданные приложения для текущего запущенного приложения изменились.
- Parameters
-
deviceManager | The device manager. |
metadata | The application metadata. May be nil if no application is currently running. |
- (void) deviceManager: |
|
( GCKDeviceManager *) |
deviceManager |
didReceiveApplicationStatusText: |
|
(NSString *__nullable) |
applicationStatusText |
|
|
| |
|
optional |
Вызывается всякий раз, когда изменяется текст состояния запущенного в данный момент приложения.
- Parameters
-
deviceManager | The device manager. |
applicationStatusText | The 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
-
deviceManager | The device manager. |
volumeLevel | The current device volume level. |
isMuted | The current device mute state. |
Вызывается всякий раз, когда изменяется состояние активного входа.
- Parameters
-
deviceManager | The device manager. |
activeInputStatus | The active input status. |
Вызывается при изменении состояния ожидания.
- Parameters
-
deviceManager | The device manager. |
standbyStatus | The standby status. |
- (void) deviceManager: |
|
( GCKDeviceManager *) |
deviceManager |
request: |
|
(NSInteger) |
requestID |
didFailWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Вызывается при сбое асинхронной операции.
- Parameters
-
deviceManager | The device manager. |
requestID | The ID of the request that failed. |
error | The error. |
Вызывается, когда к устройству установлено подключение в гостевом режиме.
- Parameters
-
deviceManager | The device manager. |
guestModeDevice | The device object for the concrete guest mode device. |
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2022-12-05 UTC.
[null,null,["Последнее обновление: 2022-12-05 UTC."],[[["The `GCKDeviceManagerDelegate` protocol defines methods that inform your app about the status of Cast devices and Cast sessions."],["These methods provide notifications for connections, disconnections, application launches, volume changes, and errors."],["Your app should implement this protocol to handle Cast-related events."],["The delegate methods are called on the main thread."],["It is important to note that unless specified, the `GCKDeviceManager` object should not be released from within a delegate method."]]],["The `GCKDeviceManagerDelegate` protocol manages interactions with Cast devices. Key actions include handling device connections (successful or failed), disconnections, and suspensions. It manages application connections, launches, failures, and disconnections. It also reports changes in application metadata, status text, volume, active input, and standby status. Additionally, it notifies when application stop requests succeed or fail, when an asynchronous operation fails and when a guest mode connection is established. The delegating object should not be released from within most delegate methods.\n"]]