Skip to content

Instantly share code, notes, and snippets.

@ddwang
Last active August 29, 2015 14:26
Show Gist options
  • Save ddwang/7c9b92606d0f82ecdc41 to your computer and use it in GitHub Desktop.
Save ddwang/7c9b92606d0f82ecdc41 to your computer and use it in GitHub Desktop.
-(void) setupLocationManager
{
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
CLBeaconRegion* region = [[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:@"07775DD0-111B-11E4-9191-0800200C9A66"]
identifier:@"XY"];
[self startRangingBeaconsInRegion:region];
}
-(void) locationManager:(CLLocationManager *) manager
didRangeBeacons:(NSArray *) beacons
inRegion:(CLBeaconRegion *) region
{
for (CLBeacon* b : beacons)
NSLog(@"Gotcha %@", b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment