Apple AirLocation demo App ranging not shows beacons
Asked Answered
B

2

7

I have3 Estimote beacons that can be seen with the App store Estimate App.

Now I am trying to run the Apple demo app AirLocation AirLocate

I have changed the UUID in the APLDefaults.m file to the default Estimote UUID _supportedProximityUUIDs = @[[[NSUUID alloc] initWithUUIDString:@"B9407F30-F5F8-466E-AFF9-25556B57FE6D"]];

I have enabled the Region to start startMonitoringForRegion as this stackoverflow says.

But they are not showing up, have you seen this ? Or am I missing some Estimate specific.

Regards

Bulldozer answered 27/9, 2014 at 21:48 Comment(0)
E
29

If you simply want a Beacon Scanner and transmission tool for testing, just download Beacon Scope for iOS.

The problem with AirLocate is that it was written for iOS7, and in iOS8, the permissions model for iBeacons and other location operations has changed. In order to get the program to work on iOS 8 when compiled from XCode 6, you need to add code that requests permission in your AppDelegate. Like this:

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

This will prompt the user to authorize location operations including beacons. You also need to edit the info.plist for the app, and add a new string key called NSLocationAlwaysUsageDescription with a value like "This app needs access to location services" so the OS can prompt the user for this permission.

After you run your app, you can check in settings to see if this permission has been granted properly.

Elodea answered 28/9, 2014 at 6:41 Comment(2)
I found I also had to ask for user permission for notifications in the AppDelegate like this post: https://mcmap.net/q/188034/-ask-for-user-permission-to-receive-uilocalnotifications-in-ios-8 or you won't get the same UI as messages as in 7. Had to set breakpoints in code to see the region notifications were actually happening. And while it works in 8 now I've found so far that it doesn't work well...only get a region notification once in a long while.Fatality
it's also worth noting that apple's example has incorrect notification keys; nevan.net/2014/09/core-location-manager-changes-in-ios-8This
C
2

Another problem I have noticed in iOS 9 is that the calibration sometimes does not work. Seems to be an NSNumber conversion issue. The following edit in APLCalibrationCalculator.m fixed it:-

  //measuredPower = [[sample valueForKeyPath:@"@avg.rssi"] integerValue];
  measuredPower = [[sample valueForKeyPath:@"@avg.rssi"] intValue];
Castellated answered 5/10, 2015 at 19:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.