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.
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.
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
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:
app: CLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"identifier"];
app: CLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid major:69 identifier:@"identifier"];
@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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With