<GCKUICastButtonDelegate> Protocol
Stay organized with collections
Save and categorize content based on your preferences.
Use the methods of this protocol to present custom dialog in response to user action.
- Since
- 4.6.0
Inherits <UIButtonNSObject>.
Tells the delegate that the cast button is tapped by the user for the first time on iOS14 or above and cast devices discovery has not started in the current or previous app sessions. More...
Tells the delegate that the cast button is tapped by the user after the discovery has been initiated in current or previous app session. More...
- (void) castButtonDidTapToPresentLocalNetworkAccessPermissionDialog: |
|
( GCKUICastButton
*) |
castButton
|
|
optional
Tells the delegate that the cast button is tapped by the user for the first time on iOS14 or above and cast devices discovery has not started in the current or previous app sessions.
Implement this method to present the custom dialog. If not implmemented, the default dialog is presented.
- Parameters
-
- (void) castButtonDidTap: |
|
( GCKUICastButton
*) |
castButton
|
toPresentDialogForCastState: |
|
(GCKCastState) |
castState
|
|
|
|
|
optional
Tells the delegate that the cast button is tapped by the user after the discovery has been initiated in current or previous app session.
Implement this method to present the custom dialog as per the cast state. Observe GCKCastContext::castState
to update the dialog dynamically as per changes in the cast state. If not implmemented, the default dialog is presented.
- Parameters
-
castButton |
Instance of GCKUICastButton
tapped. |
castState |
Cast state when the cast button is tapped. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGCKUICastButtonDelegate\u003c/code\u003e protocol allows developers to present custom dialogs in response to user interactions with the Cast button.\u003c/p\u003e\n"],["\u003cp\u003eIt provides two optional methods: \u003ccode\u003ecastButtonDidTapToPresentLocalNetworkAccessPermissionDialog:\u003c/code\u003e and \u003ccode\u003ecastButtonDidTap:toPresentDialogForCastState:\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ecastButtonDidTapToPresentLocalNetworkAccessPermissionDialog:\u003c/code\u003e is called the first time the Cast button is tapped on iOS 14 or later, before device discovery has begun.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ecastButtonDidTap:toPresentDialogForCastState:\u003c/code\u003e is called on subsequent taps of the Cast button, after device discovery has started, allowing for custom dialogs based on the current cast state.\u003c/p\u003e\n"],["\u003cp\u003eIf these methods are not implemented, default dialogs will be presented.\u003c/p\u003e\n"]]],["The `GCKUICastButtonDelegate` protocol allows for custom dialog presentation in response to user interactions with a cast button. It has two key instance methods: `castButtonDidTapToPresentLocalNetworkAccessPermissionDialog:` is triggered when the user taps the cast button for the first time on iOS 14+ without prior device discovery and allows to present a permission dialog. `castButtonDidTap:toPresentDialogForCastState:` is triggered when the user taps the button after device discovery has been initiated, allowing a custom dialog based on the cast state. If neither is implemented, the default dialog is displayed.\n"],null,["# <GCKUICastButtonDelegate> Protocol\n\n[Instance Methods](#pub-methods) \n\\\u003cGCKUICastButtonDelegate\\\u003e Protocol Reference \n\nOverview\n--------\n\nUse the methods of this protocol to present custom dialog in response to user action.\n\nSince\n: 4.6.0\n\nInherits \\\u003cUIButtonNSObject\\\u003e.\n\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (void) | - [castButtonDidTapToPresentLocalNetworkAccessPermissionDialog:](/cast/docs/reference/ios/protocol_g_c_k_u_i_cast_button_delegate-p#ac6aa5433a7e11672e979ee1d9c1cf800) |\n| | Tells the delegate that the cast button is tapped by the user for the first time on iOS14 or above and cast devices discovery has not started in the current or previous app sessions. [More...](#ac6aa5433a7e11672e979ee1d9c1cf800) |\n| ||\n| (void) | - [castButtonDidTap:toPresentDialogForCastState:](/cast/docs/reference/ios/protocol_g_c_k_u_i_cast_button_delegate-p#ac814e37993fa52f64de3334c92676bd4) |\n| | Tells the delegate that the cast button is tapped by the user after the discovery has been initiated in current or previous app session. [More...](#ac814e37993fa52f64de3334c92676bd4) |\n| ||\n\nMethod Detail\n-------------\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|\n| |-----------------------------------------------------------------------|---|----------------------------------------------------------------------------------|--------------|---| | - (void) castButtonDidTapToPresentLocalNetworkAccessPermissionDialog: | | ([GCKUICastButton](/cast/docs/reference/ios/interface_g_c_k_u_i_cast_button) \\*) | *castButton* | | | optional |\n\nTells the delegate that the cast button is tapped by the user for the first time on iOS14 or above and cast devices discovery has not started in the current or previous app sessions.\n\nImplement this method to present the custom dialog. If not implmemented, the default dialog is presented.\n\nParameters\n:\n\n |------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | castButton | Instance of [GCKUICastButton](/cast/docs/reference/ios/interface_g_c_k_u_i_cast_button \"A subclass of UIButton that implements a \\\"Cast\\\" button. \") tapped. |\n\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|\n| |------------------------------|---|----------------------------------------------------------------------------------|--------------| | - (void) castButtonDidTap: | | ([GCKUICastButton](/cast/docs/reference/ios/interface_g_c_k_u_i_cast_button) \\*) | *castButton* | | toPresentDialogForCastState: | | (GCKCastState) | *castState* | | | | | | | optional |\n\nTells the delegate that the cast button is tapped by the user after the discovery has been initiated in current or previous app session.\n\nImplement this method to present the custom dialog as per the cast state. Observe [GCKCastContext::castState](/cast/docs/reference/ios/interface_g_c_k_cast_context#a41a8b6a12d778a4ea763b0b7d1141c54 \"The current casting state for the application. \") to update the dialog dynamically as per changes in the cast state. If not implmemented, the default dialog is presented.\n\nParameters\n:\n\n |------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | castButton | Instance of [GCKUICastButton](/cast/docs/reference/ios/interface_g_c_k_u_i_cast_button \"A subclass of UIButton that implements a \\\"Cast\\\" button. \") tapped. |\n | castState | Cast state when the cast button is tapped. |"]]