3

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?

Erik Kerber
  • 5,646
  • 7
  • 38
  • 56

2 Answers2

2

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.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
0

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.

Midhun MP
  • 103,496
  • 31
  • 153
  • 200
  • I'm sorry if I was unclear. I was wondering if the 20 maximum was shared between iBeacons and geofences. Both of which are CLRegions, and both which trigger `didEnterRegion:` and `didExitRegion`. – Erik Kerber Aug 17 '15 at 11:24
  • @ErikKerber: Combined count, you can only monitor for 20 unique id – Midhun MP Aug 17 '15 at 11:26
  • But remember, geofences aren't based on what you are referring to as a unique ID. Geofences are CLCircularRegions that are based on a latitude, longitude, and radius -- not major, minor and UUID. – Erik Kerber Aug 17 '15 at 11:52
  • @ErikKerber: May be this will help in that case : http://stackoverflow.com/questions/14232712/tracking-multiple-20-locations-with-ios-geofencing – Midhun MP Aug 17 '15 at 11:56
  • No, that never even mentions beacon regions, yet alone if they share the same pool of 20 with geofences. – Erik Kerber Aug 17 '15 at 12:00