بروتوكول <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 Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],["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,[]]