While testing with beacons (ios devices) i found the listener beacon giving some unexpected behavior. locationManager:didEnterRegion method is not getting called even if a beacon enters a region. But the locationManager:didRangeBeacons:inRegion: is getting called correctly, and detected beacons are shown there.
- (void)startListening{
self.locationManager = [[CLLocationManager alloc] init];
[self.locationManager setDelegate:self];
NSUUID *myProximityUUID = [[NSUUID alloc]
initWithUUIDString:IDENTIFIER];
_beaconRegion = [[CLBeaconRegion alloc]
initWithProximityUUID:myProximityUUID
identifier:kPFTransmitterIdentifier];
_beaconRegion.notifyEntryStateOnDisplay = YES;
_beaconRegion.notifyOnEntry =YES;
[self.locationManager startMonitoringForRegion:self.beaconRegion];
[self.locationManager requestStateForRegion:self.beaconRegion];
//[self.locationManager startRangingBeaconsInRegion:self.beaconRegion];
}
this is the code i have written.
i need to create a local notification when the listener app enters a particular region even if the app isn't running.