2

Let's say I have 100 beacons clustered in one location with the same UUID and different majors/minors. I want to know when user approaches each of them and get a callback in background (didEnterRegion).

To do this I can initialize beacon regions with this method:

initWithProximityUUID:major:minor:identifier:

and use the startMonitoring method on CoreLocation. The problem is that it can listen to 20 beacon regions max. Is there any way around that ?

michal.ciurus
  • 3,616
  • 17
  • 32
  • 1
    possible duplicate of [iBeacon / Bluetooth Low Ennergy - maximum number of beacons](http://stackoverflow.com/questions/19316065/ibeacon-bluetooth-low-ennergy-maximum-number-of-beacons) – Sheshnath Dec 01 '14 at 10:17
  • Yes, but I'm asking if it's possible to do while the app is in the background. The accepted answer proposes using ranging beacons - which is a functionality only available when the app is in foreground. – michal.ciurus Dec 01 '14 at 10:23
  • 1
    No, you can range in the background -http://developer.radiusnetworks.com/2014/11/13/extending-background-ranging-on-ios.html – Paulw11 Dec 01 '14 at 10:37
  • That's probably the best answer I'll get. 3 minutes of ranging after entering beacon region. Please post it as an answer so I can mark it as answered :) – michal.ciurus Dec 01 '14 at 10:45

2 Answers2

0

There are two ways:

michal.ciurus
  • 3,616
  • 17
  • 32
0

A potential solution is to allocate a unique major value only across overlapping beacons. E.g. if you have a beacon in an office, assign a different major to each beacon in all nearby offices next door, above and below. Then for a beacon that is out of range of this office, you can then reuse the major again. Then you can monitor for UUID + major and hopefully you have less than 20. Use the minor value plus the shared major and make a unique ID for the room, e.g.

Office 1, major 1, minor 1
Office 2, major 2, minor 1
Office 3, major 1, minor 2

Office 3 is out of range of office 1 so they can use the same major. Hence you will receive a didLeaveRegion notification for office 1 followed by didEnterRegion office 3 because it is not possible to enter 3 without leaving 1.

Note this is just the theory, has not been tested yet. If you would like me to test it out then just let me know.

malhal
  • 26,330
  • 7
  • 115
  • 133