简体   繁体   中英

iBeacon identifier value -why its not working?

I am getting data from and hardware iBeacon , in which i can program to change its UUID.

I know the UUID of the hardware, but i dont understand what is the identifier in :

[[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"com.name.iBeacon"];

Is it my app identifier, or something the iBeacon is transmitting(its name?) I wonder if this is why its not working . I have set everything and i can't even discover the iBeacon :

 self.locationManager = [[CLLocationManager alloc] init];
    self.locationManager.delegate = self;

  NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"74278BDA-B644-4520-8F0C-720EAF059935"];
    self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"com.company.iBeacon"];
    [self.locationManager startMonitoringForRegion:self.beaconRegion];
      [self locationManager:self.locationManager didStartMonitoringForRegion:self.beaconRegion];

Than these delegates, which are in the same class(should be in app delegate?) are never fired :

- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region {
    [self.locationManager startRangingBeaconsInRegion:self.beaconRegion];
    NSLog(@"ENTER");

}

-(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region {
    [self.locationManager stopRangingBeaconsInRegion:self.beaconRegion];
    NSLog(@"EXIT");
}

I have read that you have to go in and out from the area ??

Another issue is, Apple says every BLE has services,that includes characteristic, but than, in iBeacon, what are the major and minor values? characteristics of the same service ?

Got it ,

 if([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
        [self.locationManager requestAlwaysAuthorization];
    }

Must be done first .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM