4
votes

In my iOs app i am trying to monitor some beacon region on different parameter as follows:

> Method 1 - Region With Only UUID and Identifier :

In above scenario am starting monitoring beacon region with following code where only uuid and identifier given.

CLBeaconRegion *region = [[CLBeaconRegion alloc] initWithProximityUUID:convertedUuid identifier:strIdentifier]; 

Method 2 - Region With UUID , Major and Identifier :

In above scenario am starting monitoring beacon region with following method where uuid, major and identifier value given

CLBeaconRegion  *region = [[CLBeaconRegion alloc] initWithProximityUUID:convertedUuid  major:[self.major intValue] identifier:strIdentifier];

Method 3 - Region with Major Minor and Identifier :

In above scenario am starting monitoring beacon region with following method where all uuid,major,minor and identifier value given

CLBeaconRegion  *region = [[CLBeaconRegion alloc] initWithProximityUUID:convertedUuid  major:[self.major intValue] minor:[self.minor intValue] identifier:strIdentifier];

Now with consideration of above 3 methods i am starting region monitoring with the following:

[self.locationManager startMonitoringForRegion:region];

Unfortunately only with the 3rd method beacons enter and exit delegate are being called. but when i use 1st or 2nd method i could not recieve enter and exit region delegate.

Note : Am not running all the method at once. i use only one method at a time.

can anyone give any feedback or provide any help why other region method is not working but only 3rd method is working?

1
@ Bhavik Try adding this method - (void)locationManager:(CLLocationManager *)manager didStartMonitoringForRegion:(CLRegion *)region { [self.locationManager startRangingBeaconsInRegion:self.myBeaconRegion]; }Developer
I don't see any reason the first method wouldn't work. It might help if you show all of your setup code in context for the first case where it doesn't work. I suspect there is some subtle difference about how you have the code setup in that case that is causing the problem, and the issue isn't what you suspect.davidgyoung
I am struggling with the same problem. Did you find a solution for that?adrian
@Bhavik, You got the solution. I have same problem. I want to call the Method 1.Kirit Modi

1 Answers

1
votes

Make sure that no other beacons with same proximityUUID (Method 1) or same proximityUUID and same major (Method 2) are around. When there is another beacon, app will not get exit events because it is still in that region defined by this proximityUUID/major.