J'ai essayé avec ce code mais les délégués n'appellent pas et n'arrêtent pas le balayage, à une condition particulière je dois appeler une autre fonction.Comment arrêter le balayage d'iBeacon
-(void)locationManager:(CLLocationManager *)manager stopRangingBeaconsInRegion:(CLBeaconRegion *)region
{
NSLog(@"STOP PLEASEEEEEEEE");
}
- (void)locationManager:(CLLocationManager *)manager stopMonitoringForRegion:(CLRegion *)region {
NSLog(@"didExitRegion");
[manager stopRangingBeaconsInRegion:(CLBeaconRegion*)region];
NSLog(@"StopRangingBeacons");
}
je utilise ce code pour démarrer le beaconScanning
-(void)loadUIElements
{
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND , 0), ^{
self.beaconRegionAny = [[AIBBeaconRegionAny alloc] initWithIdentifier:@"Any"];
[self.locationManager requestWhenInUseAuthorization];
self.locationManager.pausesLocationUpdatesAutomatically = YES;
[self.locationManager startRangingBeaconsInRegion:self.beaconRegionAny]; });
}
appeler cette fonction lors de commencer à surveiller les balises
- (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region
{
double possible de [Il est possible que stopRangingBeaconsInRegion arrêter les notifications d'une région contrôlée?] (Http://stackoverflow.com/questions/27912025/it-is- possible-que-stoprangingbeaconsinregion-stop-notifications-of-a-monitoring) – Lepidopteron
Avez-vous regardé ici? Cela semble être un problème similaire? http://stackoverflow.com/questions/27912025/it-is-possible-that-stoprangingbeaconsinregion-stop-notifications-of-a-monitored – Lepidopteron
@Lepidopteron Oui mais j'ai besoin de cet événement alors seulement je peux passer à l'étape suivante. Ce qui me préoccupe, c'est que lorsque la recherche d'une balise aura lieu un moment, je veux arrêter la numérisation, utiliser ces données pour appeler une autre fonction. – Manju