ios - didrangebeacons not called even though didDetermineState is called -


i have set of estimote beacons. when use estimote sdk, can range beacons , use it. problem is, when use ios sdk monitoring , ranging, didrangebeacons not called @ all.

i have started ranging shown below. when checked using breakpoint, function called.

- (void) locationmanager:(cllocationmanager *)manager diddeterminestate:(clregionstate)state forregion:(clregion *)region {     switch (state) {         case clregionstateinside:             [self.beaconmanager startrangingbeaconsinregion:self.beaconregion];             nslog(@"region clregionstateinside"); 

please make sure have gone through following checklist:

  1. you have entered nslocationalwaysusagedescription in info.plist

  2. your property self.beaconregion clbeacon region who's uuid matches uuid looking detect.

  3. your device iphone 4s or newer, on ios 7 or higher, , has bluetooth turned on

i change code this:

- (void)locationmanager:(cllocationmanager *)manager diddeterminestate:(clregionstate)state forregion:(nonnull clregion *)region {     clbeaconregion *beaconregion = (clbeaconregion *)region;             if (beaconregion.major && beaconregion.minor) {             } else {                 switch (state) {                     case clregionstateunknown:                         // handle case when bluetooth off.                         break;                     case clregionstateinside:                         nslog(@"inside %@", region);                         if (![self.locationmanager.rangedregions containsobject:beaconregion]) {                             [self.locationmanager startrangingbeaconsinregion:[[clbeaconregion alloc] initwithproximityuuid:beaconregion.proximityuuid identifier:beaconregion.proximityuuid.uuidstring]];                         }                         break;                 case clregionstateoutside:                     nslog(@"outside %@", region);                     break;             }         }     } 

you need range on uuid, because pick beacons match uuid regardless of major , minor. note should attempt start ranging if not ranging avoid function call


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -