Bluvision.framework Reference

The Bluvision framework provides your application with all the necessary controls to scan and write various beacon types.

Installation Instructions

  • Drag the Bluvision.framework into your Xcode project.
  • Select ‘Copy items to destination’s group folder’.
  • Under the ‘Build Settings’ tab add ‘-ObjC’ for ‘Other Linker Flags’.
  • Import the Bluvision framework header into your classes ‘#import <Bluvision/Bluvision.h>’

Getting Started

After you have linked the framework into your application you can begin scanning for beacons right away.

First make sure everything is included by importing the framework header.

#import <Bluvision/Bluvision.h>

To begin scanning for bluetooth beacons initialize the beacon manager and start scanning.

self.beaconManager = [[BLUBeaconManager alloc] initWithDelegate:self];
[self.beaconManager scanForBeacons];

For iBeacons you need to tell the beacon manager what CLBeaconRegion to monitor.

CLBeaconRegion *region = [[CLBeaconRegion alloc] initWithProximityUUID:myUUID major:major minor:minor identifier:@"com.company.app"];
[self.beaconManager startMonitoringForRegion:region];

When any beacon gets found the delegate method beaconManager:didFindBeacon: is invoked once per beacon.

- (void)beaconManager:(BLUBeaconManager *)manager didFindBeacon:(BLUBeacon *)beacon {
    // Fun Methods :)
}

Backgrounding

CoreLocation

Request location authorization

if ([BLUBeaconManager authorizationStatus] == kCLAuthorizationStatusNotDetermined) {
    [self.beaconManager requestAlwaysAuthorization];
    // OR: [self.beaconManager requestWhenInUseAuthorization];
}

Set a descriptive string for when you app asks the user for authorization. In your applications Info.plist add the keys NSLocationWhenInUseUsageDescription and NSLocationAlwaysUsageDescription. If these keys are not set then there will be no prompt from your application to request authorization from the user.

CoreBluetooth

To enable background events to be fired for bluetooth beacons in your application. Add bluetooth-central to UIBackgroundModes.