Search code examples
ioscocoa-touchbluetooth-lowenergycllocationestimote

Third Estimote beacon triggered by startMonitoringForRegion does not receive didEnterRegion or didExitRegion


In my app delegate I am registering to receive updates for didEnterRegion and didExitRegion. Specifically, in didFinishLaunchingWithOptions I declare and register to the beacons like so:

//Setup the beacon monitoring
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
locationManager.delegate=self;
for(CLRegion *r in locationManager.monitoredRegions){
    [locationManager stopMonitoringForRegion:r];
}
self.beaconManager = [[ESTBeaconManager alloc] init];
self.beaconManager.delegate = self;
[self.beaconManager requestAlwaysAuthorization];
//Build the beacons
self.beaconRegion_1=[[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:target_UUID_1]
                                                            major:target_Major_1
                                                            minor:target_Minor_1
                                                       identifier:@"BridgeRegion_1"];
self.beaconRegion_2=[[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:target_UUID_2]
                                                            major:target_Major_2
                                                            minor:target_Minor_2
                                                       identifier:@"BridgeRegion_2"];
self.beaconRegion_3=[[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:target_UUID_3]
                                                            major:target_Major_3
                                                            minor:target_Minor_3
                                                       identifier:@"BridgeRegion_3"];
self.beaconRegion_4=[[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:@"73F2C305-CE97-410E-B0DF-11D5B4021A2E"]
                                                            major:1641
                                                            minor:55555
                                                       identifier:@"BridgeRegion_4"];

//Start the monitoring
self.beaconRegion_1.notifyOnEntry = YES;
self.beaconRegion_1.notifyOnExit = YES;
self.beaconRegion_1.notifyEntryStateOnDisplay = YES;

self.beaconRegion_2.notifyOnEntry = YES;
self.beaconRegion_2.notifyOnExit = YES;
self.beaconRegion_2.notifyEntryStateOnDisplay = YES;

self.beaconRegion_3.notifyOnEntry = YES;
self.beaconRegion_3.notifyOnExit = YES;
self.beaconRegion_3.notifyEntryStateOnDisplay = YES;

/*self.beaconRegion_4.notifyOnEntry = YES;
self.beaconRegion_4.notifyOnExit = YES;
self.beaconRegion_4.notifyEntryStateOnDisplay = YES;*/

[self.beaconManager startMonitoringForRegion:self.beaconRegion_1];
[self.beaconManager startMonitoringForRegion:self.beaconRegion_2];
[self.beaconManager startMonitoringForRegion:self.beaconRegion_3];

The problem I am having is like this, which ever beacon has startMonitoringForRegion called on it third, will never trigger ANY didEnterRegion or didExitRegion calls. I have swapped the order of the calls and this rule is constant regardless of which physical beacon is called third.

I have implemented all of the delegate functions for ESTBeaconManager and nothing is being triggered out of the ordinary. Any help would be extraordinarily appreciated.


Solution

  • Essentially the issue is a limitation of that specific device configuration, I tested identical code on a clean device (iPod 5-Gen) and it performed perfectly. For the record the device with the issue was an iPhone 4s running iOS8.3(12f70).

    Not sure if this experience will help anyone in the future, but I hope it does.