GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Sensimity/TiBeacons: iBeacon advertising and scanning in a Titanium module

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

92 Commits
92 Commits

Folders and files

NameName
Last commit message
Last commit date
.settings
.settings
 
 
Classes
Classes
 
 
TiBeacons.xcodeproj
TiBeacons.xcodeproj
 
 
assets
assets
 
 
documentation
documentation
 
 
example
example
 
 
hooks
hooks
 
 
platform
platform
 
 
#manifest#
#manifest#
 
 
.DS_Store
.DS_Store
 
 
.gitignore
.gitignore
 
 
.gitignore~
.gitignore~
 
 
.project
.project
 
 
.travis.yml
.travis.yml
 
 
CHANGELOG.txt
CHANGELOG.txt
 
 
LICENSE
LICENSE
 
 
OrgBeuckmanTibeacons_Prefix.pch
OrgBeuckmanTibeacons_Prefix.pch
 
 
README.md
README.md
 
 
build.py
build.py
 
 
manifest
manifest
 
 
module.xcconfig
module.xcconfig
 
 
org.beuckman.tibeacons-iphone-0.10.0.zip
org.beuckman.tibeacons-iphone-0.10.0.zip
 
 
org.beuckman.tibeacons-iphone-0.10.1.zip
org.beuckman.tibeacons-iphone-0.10.1.zip
 
 
org.beuckman.tibeacons-iphone-0.11.0.zip
org.beuckman.tibeacons-iphone-0.11.0.zip
 
 
org.beuckman.tibeacons-iphone-0.11.1.zip
org.beuckman.tibeacons-iphone-0.11.1.zip
 
 
org.beuckman.tibeacons-iphone-0.12.0.zip
org.beuckman.tibeacons-iphone-0.12.0.zip
 
 
org.beuckman.tibeacons-iphone-0.9.1.zip
org.beuckman.tibeacons-iphone-0.9.1.zip
 
 
org.beuckman.tibeacons-iphone-0.9.2.zip
org.beuckman.tibeacons-iphone-0.9.2.zip
 
 
org.beuckman.tibeacons-iphone-0.9.3.zip
org.beuckman.tibeacons-iphone-0.9.3.zip
 
 
timodule.xml
timodule.xml
 
 
titanium.xcconfig
titanium.xcconfig
 
 

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 monitoring for iBeacons in one or more regions. This will continue in the background if the proper UIBackgroundModes are listed in tiapp.xml. Once the app has run once, iOS will start your app and run the event handler if it finds one of the monitored regions. The app does not have to be running.

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

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

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

// To stop monitoring one single region
TiBeacons.stopMonitoringRegion({
    uuid : "00000000-0000-0000-0000-000000000002",
    identifier : "Test Region 3 (device-specific)",
    major: 1,
    minor: 2
});

// To monitor regions and get notified on awake the iPhone
TiBeacons.startMonitoringRegion({
    uuid : "00000000-0000-0000-0000-000000000002",
    identifier : "Test Region 3 (device-specific)",
    major: 1,
    minor: 2,
    notifyEntryStateOnDisplay: "YES" 
});

// To stop monitoring all regions
TiBeacons.stopMonitoringAllRegions();

// Make sure you stopped ranging all beacons after stop monitoring 
TiBeacons.stopRangingForAllBeacons();

Listen for region events:

TiBeacons.addEventListener("enteredRegion", alert);
TiBeacons.addEventListener("exitedRegion", alert);
TiBeacons.addEventListener("determinedRegionState", alert);

Start ranging beacons in a region. This takes takes more energy and will report the approximate distance of the device to the beacon.

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

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);
});

Permission and Hardware Status

Get notified when the user allows or disallows location services for your app:

TiBeacons.addEventListener("changeAuthorizationStatus", function(e){
   if (e.status != "authorized") {
      Ti.API.error("not authorized");
   }
});

Find out if Bluetooth Low Energy is supported on the current device:

if (TiBeacons.isBLESupported()) {
  Ti.API.error("BLE is supported on this device");
} else {
  Ti.API.error("BLE isn't supported on this device");
]

Find out if bluetooth is on or off (or unauthorized or unsupported or resetting):

TiBeacons.addEventListener("bluetoothStatus", function(e){
   if (e.status != "on") {
      Ti.API.error("bluetooth is not on");
   }
});

TiBeacons.requestBluetoothStatus();

About

iBeacon advertising and scanning in a Titanium module

Resources

Readme
License
Activity
Custom properties

Stars

1 star

Watchers

3 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.