Giter Site home page Giter Site logo

ibeacon-utils's Introduction

iBeacon Utilits

Set of classes to handle configuration and monitoring of iBeacons

  • BeaconConfigurator
  • BeaconConfigurator Delegate
  • BeaconMonitor
  • BeaconMonitor Delegate

Beacon Configurator

Warning: It works only with RBL BLEMini device (http://blemini/) but you can simply adapt it to any device by changing the service UUID in BeaconConfigurator.m

#import "BeaconConfigurator.h"
...
// Initialize the configurator
BeaconConfigurator* configurator = [[BeaconConfigurator alloc] initWithDelegate:self];

// Start scanning for beacons
[configurator scan];

....

// Configure Beacon
// Check BeaconConfiguratorDelegate.h to see how to obtain the beacon identifiers
[configurator configureBeacon:beaconIdentifier identifier withMajor:major andMinor:minor;]

....

//Stop scanning for beacons 
[configurator stopScan];
....

Beacon Configurator Delegate

The method didDiscoverdBeacons:(NSArray*)discoveredBeacons gets called on the delegate each time the configurator discover new beacons. The discoveredBeacons array contains the identifiers of the discovered beacons. It's a good place to configure the discovered beacons with configureBeacon:identifier:withMajor:andMinor

Check BeaconConfiguratorDelegate.h to see other self-explanatory delegate's callbacks

Beacon Monitor

To obtain the shared instance, just call [BeaconMonitor sharedInstance].

#import "BeaconMonitor.h"
...
// Obtain the monitor
BeaconMonitor* monitor = [BeaconMonitor sharedInstance];

// Add a new region to monitor
[monitor addRegionWithIdentifier:@"kitchen" major:major minor:minor];

//Start monitoring
[monitor startMonitoring];
...
//Access nearest regions
NSLog(@"%@",monitor.nearestRegions) // > ["kitchen","bedroom","bathroom"]

Check BeaconMonitor.h to see other self-explanatory methods

Beacon Monitor Delegate

The method nearestRegionsDidChange:(NSArray*)regionsIdentifier gets called on the delegate each time the nearestRegions changes. Check BeaconMonitorDelegate.h to see other self-explanatory delegate's callbacks

ibeacon-utils's People

Contributors

rops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ibeacon-utils's Issues

Requires location services but not displaying

For whatever reason, can't figure out how to turn on "permission to use location-services"

Added location updates into required background modes, added CoreBluetooth and CoreLocation frameworks, but when monitoring get the "give me location permissions" modal.

The app does NOT however appear under settings: Location Services so you can't toggle it to on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.