Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
``` // android ibeacon module Alloy.Globals.iBeacons = require('com.drtech.altbeacon'); // ibeacon protocol parser Alloy.Globals.iBeacons.addBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"); Alloy.Globals.iBeacons.bindBeaconService(); if(Alloy.Globals.iBeacons.isBLESupported()) { if(Alloy.Globals.iBeacons.checkAvailability()) { console.log("checkavailability ", Alloy.Globals.iBeacons.checkAvailability()); // now we need the timer to loop and check until beacons become available... var ibeaconreadycheckinterval; var iibeacon = 0; Alloy.Globals.iBeacons.addEventListener("serviceBound", function bleServiceBound(e){ Alloy.Globals.iBeacons.removeEventListener("serviceBound", bleServiceBound); console.log("Okay! BLE is ready!"); // disable battery lurking autoranging. Alloy.Globals.iBeacons.disableAutoRanging(); // fire up actual monitoring for beacons. startBLE(); }); } } ```
- Loading branch information
0d33448
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this now works ! thank you
can i be cheeky and see your startBLE too ?
0d33448
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now doesnt throw errors but never ever finds any beacons or calls handleRegionEnter
if(Alloy.Globals.TiBeacons.isBLESupported()) {
if(Alloy.Globals.TiBeacons.checkAvailability()) {
0d33448
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function handleRegionEnter(e) {
if(OS_ANDROID) {
Ti.API.info("handleRegionEnter" + JSON.stringify(e));
}
function handleRegionExit(e) {
if(OS_ANDROID) {
Ti.API.info("handleRegionExit" + JSON.stringify(e));
}
0d33448
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last comment : guessing this could be a location permission issue does this have to be enabled?