Duncan C Duncan C - 1 month ago 4
iOS Question

Does the location manager's limit of 20 regions mean 20 total geofence AND beacon regions?

I am afraid I know the answer to this.

Apple's location manager docs for the startMonitoringForRegion method say that you can monitor a maximum of 20 regions at a time.

I have a client app that makes heavy use of both geofence regions and beacon regions.

I had assumed that there were separate 20 region limits for geofence regions and beacon regions, but I fear that the limit is actually 20 regions total for both types.

Can somebody confirm my fears based on actual experience?


Yes, the 20 region limit is the maximum that CoreLocation lets you monitor for both CLBeaconRegions and CLCircularRegions (geofences) combined. When iOS 7 added beacon support, beacon regions inherited this same limitation for geofences because of the ways the APIs were defined. And as you suspected, the limit applies to any type of region you want to monitor. So you can monitor 10 CLBeaconRegions and 10 CLCircularRegions but no more than 20 combined of each type.