Do geofences (CLCircularRegion) and iBeacons (CLBeaconRegion) share the 20 limit? - ios

Apple's shared documentation on monitoring geofences and iBeacon regions state within the geofencing section that there is a limit of 20 monitored regions for a single app:
For this reason, Core Location limits to 20 the number of regions that may be simultaneously monitored by a single app.
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html
What is unclear is if this limit is for geofences and beacon regions combined, or if each type will have a limit of 20.
Are the 20 regions a shared limit? Or can I register 20 of each?

Both CLCircularRegion and CLBeaconRegion share the same pool of 20 maximum regions that CoreLocation allows to be monitored by the single app at the same time.
This restriction predates the introduction of CLBeaconRegion in iOS 7. When Apple built beacons into the same monitoring framework, CLBeaconRegion inherited the same restriction. If you monitor 20 CLCircularRegions, then try to start monitoring a CLBeaconRegion, you will get an error.

You can only specify a maximum number of 20 unique region Ids. But you don't need to specify the major and minor value of each of those. You can have same Id for your beacons/regions and change the major and minor values to overcome this limitation.

Related

iOS, maximum UUID number of beacon ranging in CLLocation

Hi i trying to detect iBeacons.
in case of region monitoring, i knew that maximum UUID number is 20.
How about beacon ranging in CLLocation?
Have maximum UUID number limite?
Thank you in advance.
There is no hard limit to the number of regions that can be ranged by iOS Core Location. I have personally set up 100 regions to range to cover a large number of Proximity UUIDs.
That said, once you get significantly over 100 it starts to have real performance impact on the phone. There will be one callback to the delegate for each region, so with 100 regions, you will have 100 callbacks per second, and even with minimal processing in the callback CPU starts to spike. The ultimate limit will be hit when the system simply cannot keep up, and depends on other variables like the number of beacons in the vicinity, the phone model, and other processing going on at the same time.

Detecting iBeacons on iOS without supplying the UUID

I am making a react native app which monitors in background and killed state and ranges for beacons in foreground. I need to monitor more than 20 unique UUID region, to distinguish. Is there a way to monitor for beacons keeping uuid as null so it detects every beacon and then range to find uuid and send to server?
No, you must specify at least the UUID when defining a beacon region to monitor and there is a limit of 20 regions.
If you know approximately which geographic region contains which beacons that you are interested in then you could combine location services with beacon monitoring; changing the set of beacon regions based on the current geographic location.

android maximum regions to ranging and monitoring

I want to track all nearby beacons using global region, then i create individual region for each ranged region from the global region, is there any regions limit for android phone ? i've read that in the ios regions are limited into 20 max.
Any help would be appreciated
Short answer: The Android Beacon Library has no hard limit on the number of regions you can range or monitor.
Longer answer: If you go beyond a reasonable number of monitored or ranged regions (a few dozen), you may experience some issues:
Elevated CPU and battery usage will be needed to process all the region matches
A maximum of 50 monitored regions will has their state persisted across app restarts. If you go beyond 50 monitored regions, then this persistence will no longer happen, and the app will receive duplicate region entry events for nearby beacons each time the operating system restarts the app due to memory pressure.
As an alternative to monitoring a very large number of regions, consider using broader wildcard patterns in a smaller number of regions (basically specify fewer identifiers that must be matched) and then read the specific identifiers in ranging callbacks and custom logic based on the identifier patterns you see there.
It is worth noting that with iOS CoreLocation, there is also no limit to the number of regions that may be ranged. The limit of 20 regions is for monitoring only, and applies to both geofence regions and beacon regions.

Ranging 500 iBeacons using one UUID

Let's say I have 500 iBeacons deployed that I want to use with one app.
Can I have one UUID for all 500 beacons and specific major and minor identifiers to each of the 500 beacons?
If so, can I monitor the region of my UUID and start ranging for the specific major and minor identifiers once the region is entered?
I'm confused as to what ranging actually does. Can I get the major and minor identifiers from ranging, or I will only get the distance from the device?
Yes, you can have all your beacons included in a single region defined by the UUID. It can be 500 beacons or much more: there is no upper limit. Then if you enter this region and start ranging, you'll receive a list of beacons in range, along with Major and Minor IDs. Keep in mind though that not all beacons in this region have to be in range.
I think this article we posted on Estimote Community Portal explains difference between monitoring and ranging quite well: https://community.estimote.com/hc/en-us/articles/203356607-What-are-region-Monitoring-and-Ranging-
Cheers.
The major and minor values are unsigned short integers, so that means they can store a number no greater than 65'536 within them, so in theory you can monitor and see up to 4'294'967'296 beacons per UUID, and you can have 20 of those.
Monitoring can be done in the background, Ranging needs to be done in the foreground.
Monitoring is a low power activity, ranging I read isn't.
Monitoring can be slow to react, too slow for many, especially if your looking at region triggers, entering is ok, leaving can take 10 to 15 seconds or more. Ranging in contrast is almost immediate, and quite dependable. I tried both and gave up on relying on monitoring, you need your app to be running in foreground; ranging in an ideal world.

CLLocationManager startMonitoringForRegion limitations

In the Apple documentation for startMonitoringForRegion method there is this text:
An app can register up to 20 regions at a time. In order to report region changes in a timely manner, the region monitoring service requires network connectivity.
Do this 20 regions are only for this app or globally?
It's 20 regions per app. I don't know if there's a top number globally (i.e. for the device).

Resources