Beacons in Ionic


#1

Hello all, am working with beacons in ionic 2 and am unable to make a call for any delegate functions. Am passing my device UUID to get the beacon region but nothing is showing up. The following is my code.

let locationManager = window.cordova.plugins.locationManager;
    var region = locationManager.BeaconRegion("Ionic_beacon", uuid);
    alert(region);
    locationManager.enableBluetooth();
let delegate = new locationManager.Delegate();

delegate.didDetermineStateForRegion = function (pluginResult) {
    alert('in delaget');

    alert('[DOM] didDetermineStateForRegion: ' + JSON.stringify(pluginResult));

    locationManager.appendToDeviceLog('[DOM] didDetermineStateForRegion: '
        + JSON.stringify(pluginResult));
};

Am trying to get the region, bluetooth is enabling but, it is not entering ‘delegate.didDetermineStateForRegion’ function. My UUID is something like ‘d367gdheyr…hj’ and platform is android. Any help please.


#2

And what is this?

Where does this come from?

Although you might think otherwise, we people here don’t know ALL cordova plugins by heart…


#3

A cordova plugin that lets the app to enable location permissions to access devices within range… The following is the reference link I used.


#4

Then this exists which should make using it a bit easier:


#5

Hi, not sure if this will help you - I did write it a while ago and I haven’t worked with beacons much recently.


#6

Hello! Im interested in beacons as well and nothing work for me :frowning: @richardshergold really good your tutorial, thanks you very much! I saw a weeks ago and tried to run it but It didn’t work for me… Maybe is for Ionic version?