I am working on a beacon monitoring project and currently I am investigating the stopMonitoringForRegion method. What I am doing is, duplicate the original region and start a new monitoring for it. After 30 - 60 seconds, I stop the copied region:
[self.locationManager stopMonitoringForRegion:self.duplicatedRegion];
So the original and the duplicated regions minor and major ids are same. When I stop monitoring the duplicated region am I also stoping the original region? Because the minor and major ids are same. The only difference in between the original and duplicated region is the identifiers. The original one has a Vendor GUID whereas the duplicated has "testRegion" string.
self.duplicatedRegion = [[CLBeaconRegion alloc] initWithProximityUUID:self.originalRegion.proximityUUID
major:[self.originalRegion.major intValue]
minor:[self.originalRegion.minor intValue]
identifier:@"testRegion"];
self.duplicatedRegion.notifyEntryStateOnDisplay = NO;
self.duplicatedRegion.notifyOnEntry = YES;
self.duplicatedRegion.notifyOnExit = YES;
[self.locationManager startMonitoringForRegion:self.duplicatedRegion];
I am asking this because when I stop monitoring the duplicated region, the app doesn't receive any enter and exit region events anymore. In my code I am checking whether the original region is being monitored and yes it is on the self.locationManager monitoredRegions array. Also I never stop the original region. I am just start and stoping the duplicated one.