Giao thức <GCKDeviceManagerDelegate>
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Giao thức uỷ quyền GCKDeviceManager.
Trừ phi có quy định khác, phương thức gọi không được giải phóng đối tượng GCKDeviceManager uỷ quyền trong một phương thức uỷ quyền.
Kế thừa <NSObjectNSObject>.
Được gọi khi một kết nối đã được thiết lập với thiết bị.
- Parameters
-
deviceManager | The device manager. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didFailToConnectWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Được gọi khi kết nối với thiết bị không thành công.
Bạn có thể yên tâm giải phóng đối tượng GCKDeviceManager trong lệnh gọi lại này.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the connection to fail. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didDisconnectWithError: |
|
(NSError *__nullable) |
error |
|
|
| |
|
optional |
Được gọi khi kết nối với thiết bị đã bị chấm dứt.
Bạn có thể yên tâm giải phóng đối tượng GCKDeviceManager trong lệnh gọi lại này.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the disconnection; nil if there was no error (for example, an intentional disconnect). |
Được gọi khi kết nối với thiết bị bị tạm ngưng, có thể là tạm thời.
Khi một kết nối bị tạm ngưng, trình quản lý thiết bị sẽ tự động tìm cách thiết lập lại kết nối vào thời điểm thích hợp. Ứng dụng gọi điện không được tìm cách tự động kết nối lại.
- Parameters
-
deviceManager | The device manager. |
reason | The reason for the suspension. |
- (void) deviceManagerDidResumeConnection: |
|
(GCKDeviceManager *) |
deviceManager |
rejoinedApplication: |
|
(BOOL) |
rejoinedApplication |
|
|
| |
|
optional |
Được gọi khi một kết nối thiết bị đã bị tạm ngưng trước đó được thiết lập lại.
- 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 |
Được gọi khi một ứng dụng đã được khởi chạy hoặc tham gia.
- 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 |
Được gọi khi không kết nối được với một ứng dụng.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the failure. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didDisconnectFromApplicationWithError: |
|
(NSError *__nullable) |
error |
|
|
| |
|
optional |
Được gọi khi ngắt kết nối khỏi ứng dụng hiện tại.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the disconnect, or nil if this was a normal disconnect. |
Được gọi khi yêu cầu dừng ứng dụng đã hoàn tất thành công.
- Parameters
-
deviceManager | The device manager. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didFailToStopApplicationWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Được gọi khi yêu cầu dừng ứng dụng không thành công.
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the failure. |
Được gọi bất cứ khi nào siêu dữ liệu ứng dụng cho ứng dụng hiện đang chạy thay đổi.
- 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 |
Được gọi bất cứ khi nào văn bản trạng thái của ứng dụng đang chạy thay đổi.
- 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 |
Được gọi bất cứ khi nào âm lượng thay đổi.
- Parameters
-
deviceManager | The device manager. |
volumeLevel | The current device volume level. |
isMuted | The current device mute state. |
Được gọi bất cứ khi nào trạng thái đầu vào đang hoạt động thay đổi.
- Parameters
-
deviceManager | The device manager. |
activeInputStatus | The active input status. |
Được gọi bất cứ khi nào trạng thái chờ thay đổi.
- Parameters
-
deviceManager | The device manager. |
standbyStatus | The standby status. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
request: |
|
(NSInteger) |
requestID |
didFailWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Được gọi khi một thao tác không đồng bộ không thành công.
- Parameters
-
deviceManager | The device manager. |
requestID | The ID of the request that failed. |
error | The error. |
Được gọi khi một kết nối ở chế độ khách đã được thiết lập với thiết bị.
- Parameters
-
deviceManager | The device manager. |
guestModeDevice | The device object for the concrete guest mode device. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],["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"],null,[]]