8

Since iOS7.1, iBeacon regions can be monitored without the app being open in the fore- or background. While this is more of a lab situation than a real world problem, I was wondering what happens when two iOS apps both register to monitor the same iBeacon region in the background. Let's say, both apps are set to trigger a local notification when a specific region is entered...

Is there any expected/documented behaviour in this case? E.g. 1) both apps will be triggered? 2) only the last app that registered will be triggered? 3) etc.

theremin
  • 896
  • 8
  • 20

5 Answers5

9

Both apps will be triggered. I do not believe this is explicitly stated in Apple docs, but by design all apps are sandboxed and are expected to behave independently unless docs say otherwise.

I can confirm this is the way it works from experience because my company makes lots of iBeacon apps, and they are initially built to use the same default UUID/major/minor for Radius Networks' beacons. As a result, when I turn on my iPhone in the proximity of one of these beacons, I get multiple notifications, one for each app monitoring for the same region.

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

Both app will be triggered. I have some beacons in my house , if i dont turn bluetooth off when i enter or leave, i get one notification for each app i m working on ... :p

mad_mask
  • 776
  • 2
  • 10
  • 31
3

I can confirm what Alexander Vasenin said as well. I tested it on iOS 9.0.2.

If your situation allows it, you can "bypass" this by setting one of your apps to use a more "strict" region, for example:

  1. app: CLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"identifier"];

  2. app: CLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid major:69 identifier:@"identifier"];

Nejc
  • 123
  • 1
  • 9
2

@Alexander Vasenin: I can confirm this. There seems to be an ios 8.3 problem where no 2 apps can monitor the SAME region. In that case only one app gets the responses.

woens
  • 1,058
  • 9
  • 20
1

While generally monitoring the same iBeacon region by multiple apps works well, yesterday we've run into troubles with this. Two of our devices refused to call any of the following callbacks:

- locationManager:didDetermineState:forRegion:
- locationManager:didEnterRegion:
- locationManager:didExitRegion:
- locationManager:monitoringDidFailForRegion:withError:

while other two worked flawlessly. We spent several hours figuring out what's wrong, but the problem was solved only after we've deleted old proof-of-concept app which was monitoring the same (or almost the same, I'm not sure about this) iBeacon region from both devices.

Interestingly, on my own device I also have that old proof-of-concept app and both apps works flawlessly.

Alexander Vasenin
  • 11,437
  • 4
  • 42
  • 70