A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_discovery_manager below:

GCKDiscoveryManager Class | Cast | Google for Developers

GCKDiscoveryManager Class

Stay organized with collections Save and categorize content based on your preferences.

A class that manages the device discovery process.

GCKDiscoveryManager manages a collection of GCKDeviceProvider subclass instances, each of which is responsible for discovering devices of a specific type. It also maintains a lexicographically ordered list of the currently discovered devices.

The framework automatically starts the discovery process when the application moves to the foreground and suspends it when the application moves to the background. It is generally not necessary for the application to call startDiscovery (GCKDiscoveryManager) and stopDiscovery (GCKDiscoveryManager), except as an optimization measure to reduce network traffic and CPU utilization in areas of the application that do not use Cast functionality.

If the application is using the framework's Cast dialog, either by way of GCKUICastButton or by presenting it directly, then that dialog will use GCKDiscoveryManager to populate its list of available devices. If however the application is providing its own device selection/control dialog UI, then it should use the GCKDiscoveryManager and its associated listener protocol, GCKDiscoveryManagerListener, to populate and update its list of available devices.

Since
3.0

Inherits NSObject.

Default initializer is not available.

Adds a listener that will receive discovery notifications.

The added listener is weakly held, and should be retained to avoid unexpected deallocation.

Parameters
listener The listener to add.

Removes a previously registered listener.

Parameters
listener The listener to remove.

Starts the discovery process.

Stops the discovery process.

- (BOOL) isDiscoveryActiveForDeviceCategory: (NSString *)  deviceCategory

Tests whether discovery is currently active for the given device category.

- (GCKDevice *) deviceAtIndex: (NSUInteger)  index

Returns the device at the given index in the manager's list of discovered devices.

- (nullable GCKDevice *) deviceWithUniqueID: (NSString *)  uniqueID

Returns the device with the given unique ID in the manager's list of discovered devices.

Parameters
uniqueID The device's unique ID.
Returns
The matching GCKDevice object, or nil if a matching device was not found.
- (void) findDeviceWithUniqueID: (NSString *)  uniqueID timeout: (NSTimeInterval)  timeout completion: (void(^)(GCKDevice *))  completion 

Waits for a device with the given unique ID to be discovered, and invokes a completion block.

If a matching device is already in the discovered device list, the completion block will be invoked immediately (but after this method returns). Only one find operation can be active at a time; starting a new find operation while another one is in progress will cancel the current one.

Parameters
uniqueID The unique ID of the device. timeout The maximum amount of time to wait for the device to be discovered. completion The completion block to invoke when either the device is found or the timeout is reached. The device (if found) or nil (if not found) will be passed to the completion block.
Since
4.0
- (void) cancelFindOperation

Cancels any in-progress find operation started by findDeviceWithUniqueID:timeout:completion:.

Since
4.0
- (GCKDiscoveryState) discoveryState readnonatomicassign

The current discovery state.

- (BOOL) hasDiscoveredDevices readnonatomicassign

A flag indicating whether any devices have been discovered by any of the discovery providers managed by this object.

A flag indicating whether discovery should employ a "passive" scan.

Passive scans are less resource-intensive but do not provide results that are as fresh as active scans.

A flag indicating whether discovery is active or not.

Since
3.4
- (NSUInteger) deviceCount readnonatomicassign

The number of devices that are currently discovered.

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."],[[["The `GCKDiscoveryManager` class manages the discovery of Cast devices and provides a list of available devices."],["It automatically starts and stops discovery when the app enters the foreground or background, respectively."],["Developers can use `GCKDiscoveryManager` to populate their own Cast device selection UI or rely on the framework's Cast dialog."],["Discovery can be optimized by manually starting and stopping it when Cast functionality is not needed."],["Methods are provided to add and remove listeners for discovery notifications, start and stop discovery, check discovery status, retrieve discovered devices, find a specific device, and cancel find operations."]]],["The `GCKDiscoveryManager` class manages device discovery, maintaining a list of discovered devices. It automatically starts discovery in the foreground and suspends it in the background, but `startDiscovery` and `stopDiscovery` can be used manually. It supports adding and removing listeners for discovery notifications. Key actions include checking if discovery is active, finding a device by index or unique ID, or waiting for a specific device via `findDeviceWithUniqueID`. The class's properties provide the discovery state, number of discovered devices, and whether any devices have been found. It also has the ability to use passive scans.\n"]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4