0

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?

Tommz
  • 3,393
  • 7
  • 32
  • 44
  • You need to request always or when in use authorisation and put the appropriate keys in your Info.plist - http://stackoverflow.com/questions/24062509/location-services-not-working-in-ios-8/24063578#24063578 – Paulw11 Dec 02 '14 at 20:15

1 Answers1

2

You need to ask for location permission in iOS 8, and also added a the usage description string in your plist file.

Check out this answer for more detail: https://stackoverflow.com/a/24063578/361247

Community
  • 1
  • 1
Enrico Susatyo
  • 19,372
  • 18
  • 95
  • 156
  • Yea, that was it :). Found one good article on that matter, if someone would use from it: http://nevan.net/2014/09/core-location-manager-changes-in-ios-8/ – Tommz Dec 17 '14 at 01:26