objective c - Location manager not monitoring Beacons -
i not getting region entry , exit events beacon regions. how add beacon monitoredregions:
nsuuid *uuid = [[nsuuid alloc] initwithuuidstring: beacon.uuid]; clbeaconregion *region = [[clbeaconregion alloc] initwithproximityuuid: uuid major: (clbeaconmajorvalue) beacon.major minor: (clbeaconmajorvalue) beacon.minor identifier: @"some identifier"]; [_locationmanager startmonitoringforregion: region];
and events:
- (void) locationmanager: (cllocationmanager *) manager didenterregion: (clregion *) region { nslog(@"entered beacon region"); } - (void) locationmanager: (cllocationmanager *) manager didexitregion: (clregion *) region { nslog(@"exited beacon region"); }
none of these delegate events called beacon region.
i have tested geographical regions , works not work beacon. have tested ranging on same beacon works.
are there known issues beacon monitoring??
many thanks
hi @ldsarria check steps working me
step 1 : set delgate in .h file cllocationmanagerdelegate
step 2:
locationmanager = [[cllocationmanager alloc] init]; locationmanager.delegate = self; locationmanager.desiredaccuracy = kcllocationaccuracybest; locationmanager.distancefilter = kcldistancefilternone;
step 3:
nsuuid *uuid = [[nsuuid alloc] initwithuuidstring:@"some identifier"]; clbeaconregion *region = [[clbeaconregion alloc] initwithproximityuuid:uuid identifier:@"com.test.abc"]; region.notifyentrystateondisplay =yes; [locationmanager startmonitoringforregion:region];
step 4: set nslocationalwaysusagedescription = "this app needs location hunt treasure."
cheers!!!
Comments
Post a Comment