Skip to content

Instantly share code, notes, and snippets.

@hjanuschka
Created November 23, 2016 10:45
Show Gist options
  • Save hjanuschka/6c5944ec6cf04a9acb4220f44edfacb5 to your computer and use it in GitHub Desktop.
Save hjanuschka/6c5944ec6cf04a9acb4220f44edfacb5 to your computer and use it in GitHub Desktop.
//create UUID with xamooms Beacon UUID
NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"de2b94ae-ed98-11e4-3432-78616d6f6f6d"];
//create beacon region your major
self.beaconRegion = [[CLBeaconRegion alloc]
initWithProximityUUID:uuid
identifier:@"my xamoom system beacons"];
//init locationmanager
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
//request location permission
if ([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
[self.locationManager requestAlwaysAuthorization];
}
//start monitoring beacons
[self.locationManager startMonitoringForRegion:self.beaconRegion];
// BEACONS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment