AI-generated Key Takeaways
-
The
GNSBeaconStrategyclass defines the strategy used to scan for nearby beacons, including iBeacons and Eddystone beacons. -
It provides methods for creating default and custom strategies, allowing control over scan behavior like background scanning and power usage.
-
The
includeIBeaconsproperty determines whether to scan for iBeacons alongside Eddystone beacons, requiring location permissions if enabled. -
allowInBackgroundenables scanning while the app is in the background, whilelowPowerPreferredprioritizes lower battery consumption when scanning for Eddystone beacons only.
Overview
The strategy to use to scan for beacons.
Inherits NSObject.
Class Method Summary | |
| (instancetype) | + strategy |
| Returns the default strategy, which uses the default values for all properties. More... | |
| (instancetype) | + strategyWithParamsBlock: |
Returns a custom strategy. You can set any of the optional properties in paramsBlock. More... | |
Property Summary | |
| BOOL | includeIBeacons |
| Scan also for nearby iBeacons. More... | |
| BOOL | allowInBackground |
| Try to scan for beacons when the app is in the background. More... | |
| BOOL | lowPowerPreferred |
| Low power mode is available when scanning for Eddystone beacons only; it is ignored when iBeacons are included. More... | |
Method Detail
| + (instancetype) strategy |
Returns the default strategy, which uses the default values for all properties.
| + (instancetype) strategyWithParamsBlock: | (void(^)(GNSBeaconStrategyParams *)) | paramsBlock |
Returns a custom strategy. You can set any of the optional properties in paramsBlock.
Property Detail
|
readnonatomicassign |
Scan also for nearby iBeacons.
The default is YES. Scanning for iBeacons triggers a location permission dialog from iOS, so you should set this to NO if you don't want to scan for iBeacons.
|
readnonatomicassign |
Try to scan for beacons when the app is in the background.
The default is NO.
|
readnonatomicassign |
Low power mode is available when scanning for Eddystone beacons only; it is ignored when iBeacons are included.
Turn off low power mode if you prefer lower latency scanning, at a higher battery cost.
The default is YES.