Skip to content
forked from jbeuckm/TiBeacons

iBeacon advertising and scanning in a Titanium module

License

Notifications You must be signed in to change notification settings

JigarM/TiBeacons

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

See this example app for usage: TiBeacons Example App

Become an iBeacon:

var TiBeacons = require('org.beuckman.tibeacons');

TiBeacons.addEventListener("advertisingStatus", function(event) {
    Ti.API.info(event.status);
});

TiBeacons.startAdvertisingBeacon({
   uuid : "00000000-0000-0000-0000-000000000000",
   identifier : "TiBeacon Test",
   major: 1,
   minor: 2
});

Start scanning for iBeacons in one or more regions:

TiBeacons.startRangingForBeacons({
    uuid : "00000000-0000-0000-0000-000000000000",
    identifier : "Test Region 1",
});

TiBeacons.startRangingForBeacons({
    uuid : "00000000-0000-0000-0000-000000000001",
    identifier : "Test Region 2 (group-specific)",
    major: 1
});

TiBeacons.startRangingForBeacons({
    uuid : "00000000-0000-0000-0000-000000000002",
    identifier : "Test Region 3 (device-specific)",
    major: 1,
    minor: 2
});

Listen for the range events:

TiBeacons.addEventListener("beaconRanges", function(event) {
   alert(event.beacons);
});

Or just listen for beacon proximity changes:

TiBeacons.addEventListener("beaconProximity", function(e){
   alert("beacon "+e.major+"/"+e.minor+" is now "+e.proximity);
});

About

iBeacon advertising and scanning in a Titanium module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published