I've downloaded app for configuring beacons that I bought from Accent systems. It recognises beacon that is transmitting and I can easily configure it. I've used uuidgen tool to make some UUID for beacon and set it up in application. Let's say that this generated UUID is "XXX-XXX" (I know that it's longer and that it's HEX value). So, how it's set in my beacon is following:
UUID: XXX-XXX Major : 1111 Minor : 0001
That same UUID I used in my code. I've set my View Controller to CLLocationManagerDelegate
and in viewDidLoad
method I have following code:
NSUUID *myUUID = [[NSUUID alloc] initWithUUIDString:@"XXX-XXX"];
CLBeaconRegion *region = [[CLBeaconRegion alloc] initWithProximityUUID:myUUID
identifier:@"Company"];
CLLocationManager *locManager = [[CLLocationManager alloc] init];
[locManager setDelegate:self];
[locManager startRangingBeaconsInRegion:region];
I've also set following methods in that view controller, but they never get called:
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
- (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons
inRegion:(CLBeaconRegion *)region
I'm testing this on Ipad Air and bluetooth is ON.
Why do that never get called? What am I doing wrong?