Protokół <GCKDeviceManagerDelegate>
Protokół przekazywania GCKDeviceManager.
O ile nie wskazano inaczej, element wywołujący nie powinien przekazywać obiektu przekazującego GCKDeviceManager z metody z przekazanym dostępem.
Dziedziczy obiekt <NSObjectNSObject>.
Wywołanie po nawiązaniu połączenia z urządzeniem.
- Parameters
-
deviceManager | The device manager. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didFailToConnectWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Wywoływane, gdy nie udało się połączyć z urządzeniem.
Możesz bezpiecznie zwolnić obiekt GCKDeviceManager z tego wywołania zwrotnego.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the connection to fail. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didDisconnectWithError: |
|
(NSError *__nullable) |
error |
|
|
| |
|
optional |
Wywołane po zakończeniu połączenia z urządzeniem.
Możesz bezpiecznie zwolnić obiekt GCKDeviceManager z tego wywołania zwrotnego.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the disconnection; nil if there was no error (for example, an intentional disconnect). |
Wywołano, gdy połączenie z urządzeniem zostało zawieszone. Może to być tymczasowe.
Gdy połączenie zostanie zawieszone, menedżer urządzenia automatycznie spróbuje ponownie je utworzyć w odpowiednim momencie. Aplikacja do wykonywania połączeń nie powinna próbować wymusić ponownego połączenia.
- Parameters
-
deviceManager | The device manager. |
reason | The reason for the suspension. |
- (void) deviceManagerDidResumeConnection: |
|
(GCKDeviceManager *) |
deviceManager |
rejoinedApplication: |
|
(BOOL) |
rejoinedApplication |
|
|
| |
|
optional |
Wywołano po przywróceniu poprzednio zawieszonego urządzenia.
- 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 |
Wywoływana, gdy aplikacja zostanie uruchomiona lub do niej dołączona.
- 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 |
Wywołanie podczas nawiązywania połączenia z aplikacją.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the failure. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didDisconnectFromApplicationWithError: |
|
(NSError *__nullable) |
error |
|
|
| |
|
optional |
Wywołanie po rozłączeniu z bieżącą aplikacją.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the disconnect, or nil if this was a normal disconnect. |
Wywołano, gdy żądanie zatrzymania aplikacji zostało wykonane.
- Parameters
-
deviceManager | The device manager. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didFailToStopApplicationWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Wywoływane, gdy nie można zrealizować żądania zatrzymania aplikacji.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the failure. |
Wywoływane po każdej zmianie metadanych bieżącej aplikacji.
- 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 |
Wywoływane po każdej zmianie bieżącego tekstu stanu aplikacji.
- 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 |
Wywoływane po każdej zmianie głośności.
- Parameters
-
deviceManager | The device manager. |
volumeLevel | The current device volume level. |
isMuted | The current device mute state. |
Wywoływane po każdej zmianie stanu działania.
- Parameters
-
deviceManager | The device manager. |
activeInputStatus | The active input status. |
Wywoływane po każdej zmianie stanu gotowości.
- Parameters
-
deviceManager | The device manager. |
standbyStatus | The standby status. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
request: |
|
(NSInteger) |
requestID |
didFailWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Wywoływane, gdy operacja asynchroniczny nie powiodła się.
- Parameters
-
deviceManager | The device manager. |
requestID | The ID of the request that failed. |
error | The error. |
Wywoływane, gdy na urządzeniu zostanie nawiązane połączenie w trybie gościa.
- Parameters
-
deviceManager | The device manager. |
guestModeDevice | The device object for the concrete guest mode device. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2022-12-06 UTC.
[null,null,["Ostatnia aktualizacja: 2022-12-06 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."]]],[]]