BeaconRegion is Nil

I have a fairly intense view with two subviews, core location, and Parse.

My Beacon Region cannot get initialized. I have copied the code in the notification example.

I have successfully ran the demos.

I'm using pods.

{pod 'EstimoteSDK', pod 'Parse', '~> 1.4', pod 'ParseFacebookUtils', '~> 1.4', pod 'Facebook-iOS-SDK', '~> 3.19'}

IOS VERSION: 8.1, Xcode 6.1 (6A1052d)

Here is Pseudo Code:

SomethingViewController.h

#import <CoreLocation/CoreLocation.h>
#import <EstimoteSDK/ESTBeacon.h>
#import <MapKit/MapKit.h>
#import <UIKit/UIKit.h>
#import and more....

@interface SomethingViewController : UIViewController <MKMapViewDelegate,
CLLocationManagerDelegate, RNFrostedSidebarDelegate, ESTBeaconDelegate>

  • (id)initWithBeacon:(ESTBeacon *)beacon;

@property (nonatomic, weak) id<SomethingControllerDelegate> delegate;
@property (nonatomic, strong) IBOutlet MKMapView *mapView;
@end

SomethingViewController.m

@interface SomethingViewController ()
<SomethingTableViewControllerDataSource,
SomethingCreateViewControllerDataSource,
ESTBeaconManagerDelegate>

@property (nonatomic, strong) ESTBeacon *beacon;
@property (nonatomic, strong) ESTBeaconManager *beaconManager;
@property (nonatomic, strong) ESTBeaconRegion *beaconRegion;

  • (id)initWithBeacon:(ESTBeacon *)beacon { self = [super init]; if (self) { self.beacon = beacon; } return self; }
  • (id)init { self = [super init]; if (self) {
    self.title = @"Application Title";

and Two other notifications...

  • (void)viewDidLoad {
    [super viewDidLoad];

    ESTBeacon *beacon = [[ESTBeacon alloc] init]; //Seen in debugger
    self.beaconManager = [[ESTBeaconManager alloc] init]; //Seen in Debugger
    self.beaconManager.delegate = self; //Seen in Debugger
    self.beaconRegion = [[ESTBeaconRegion alloc] initWithProximityUUID:self.beacon.proximityUUID
    major:[self.beacon.major unsignedIntValue]
    minor:[self.beacon.minor unsignedIntValue]
    identifier:@"RegionIdentifier"];

/// Under Self in the debugger, this returns null

self.beaconRegion.notifyOnEntry = TRUE;   //Instead of a ui button
self.beaconRegion.notifyOnExit = TRUE;    //Instead of a ui button
[self.beaconManager startMonitoringForRegion:self.beaconRegion];  

And the Did Enter, Did Exit Routines that I assume are called by the active manager based on a valid region.

Questions:

  1. Can Core Location conflict with beacons?
  2. What about the Init above?
  3. Is my problem delegates?

Sorry, the beacon region code highlighted for some reason. Anyway, lots going on in this view - and I see the declarations are in the debugger, they just come back nil.

(BTW, I didn't mention, my .plist is the same as yours w/rt permissions.)

Hey John—the problem originates here:

ESTBeacon *beacon = [[ESTBeacon alloc] init]; //Seen in debugger
...
self.beaconRegion = [[ESTBeaconRegion alloc]
                     initWithProximityUUID:self.beacon.proximityUUID
                     major:[self.beacon.major unsignedIntValue]
                     minor:[self.beacon.minor unsignedIntValue]
                     identifier:@"RegionIdentifier"];

You create an empty ESTBeacon instance and then use it to define the region, which results in the region being empty as well. In general, you should never create an instance of an ESTBeacon yourself—it should always come from the ESTBeaconManagerDelegate methods.

If you have a specific beacon in mind, then go to the Estimote app, find it on the radar/list, note down its UUID, major and minor and use them to create the ESTBeaconRegion.