GCKDeviceScanner Class
Stay organized with collections
Save and categorize content based on your preferences.
A class that asynchronously scans for available devices and sends corresponding notifications to its listener(s).
This class is implicitly a singleton; since it does a network scan, it isn't useful to have more than one instance of it in use.
- Deprecated:
- Use GCKDiscoveryManager
to discover Cast receivers.
Inherits NSObject.
Stops any in-progress device scan. More...
Adds a listener for receiving notifications. More...
The array of discovered devices. More...
Whether the current/latest scan has discovered any devices. More...
Whether a scan is currently in progress. More...
The current filtering criteria. More...
Whether the scan should be a passive scan. More...
- (instancetype) initWithFilterCriteria: |
|
( GCKFilterCriteria
*__nullable) |
filterCriteria
|
|
Designated initializer.
Constructs a new GCKDeviceScanner
with the given filter criteria.
- Parameters
-
filterCriteria
The filter criteria. May not be nil
.
Starts a new device scan.
The scan must eventually be stopped by calling stopScan
.
Stops any in-progress device scan.
This method must
be called at some point after startScan
was called and before this object is released by its owner.
Adds a listener for receiving notifications.
- Parameters
-
listener
The listener to add.
Removes a listener that was previously added with addListener:
.
- Parameters
-
listener
The listener to remove.
The array of discovered devices.
- (BOOL) hasDiscoveredDevices
read
nonatomic
assign
Whether the current/latest scan has discovered any devices.
Whether a scan is currently in progress.
read
write
nonatomic
copy
The current filtering criteria.
read
write
nonatomic
assign
Whether the scan should be a passive scan.
A passive scan sends discovery queries less frequently, so it is more efficient, but the results will not be as fresh. It's appropriate to do a passive scan when the user is not actively selecting a Cast target.
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\u003e\u003ccode\u003eGCKDeviceScanner\u003c/code\u003e asynchronously scans for available Google Cast devices and notifies its listeners.\u003c/p\u003e\n"],["\u003cp\u003eThis class is deprecated; use \u003ccode\u003eGCKDiscoveryManager\u003c/code\u003e for discovering Cast receivers instead.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to start and stop device scans, and to add or remove listeners for scan results.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGCKDeviceScanner\u003c/code\u003e offers properties to access discovered devices, scan status, filtering criteria, and scan type (passive or active).\u003c/p\u003e\n"]]],["The `GCKDeviceScanner` class manages asynchronous device discovery, notifying listeners of available devices. Key actions include: constructing a scanner with optional filter criteria, starting and stopping scans, and adding/removing listeners. It maintains a list of discovered devices and provides properties to check if devices were found, if a scan is active, the filtering criteria and whether it is a passive scan. This class is deprecated and the use of `GCKDiscoveryManager` is advised instead.\n"],null,[]]