petermetz / cordova-plugin-ibeacon

An iBeacon plugin for Phonegap / Cordova 3.x and upwards. Supports both iOS and Android (contributions are welcome)
Apache License 2.0
726 stars 373 forks source link

Monitoring for multiple regions(uuids) #166

Open FranciZ opened 9 years ago

FranciZ commented 9 years ago

After some research I realise that iOS can monitor for up to 20 regions(uuids) at a time and that Android has no such restriction. Is it possible using this plugin to define an array of regions(uuids) and monitor for change in state for each region?

Below is the closest to what I think should work but the delegate only returns change in state for one of the regions.


var delegate = new cordova.plugins.locationManager.Delegate();
cordova.plugins.locationManager.requestAlwaysAuthorization();

delegate.didDetermineStateForRegion = function(pluginResult){
        console.log(JSON.stringify(pluginResult));
}

cordova.plugins.locationManager.setDelegate(delegate);

var beaconRegion1 = new cordova.plugins.locationManager.BeaconRegion(identifier, uuid2);
var beaconRegion2 = new cordova.plugins.locationManager.BeaconRegion(identifier, uuid3);

cordova.plugins.locationManager.startMonitoringForRegion(beaconRegion1)
                .fail(console.error)
                .done();

cordova.plugins.locationManager.startMonitoringForRegion(beaconRegion2)
                .fail(console.error)
                .done();
0x1ad2 commented 8 years ago

I'm also experiencing this. On Android everything works like a charm setup 3 regions all get monitored but on iOS it will only monitor the first region.

0x1ad2 commented 8 years ago

Is there a fix available anywhere? We've tried to contact @petermetz but without any result, is someone willing and able to fix this? We even could arrange a pay, we need it asap.

pure4Sk commented 8 years ago

Is it fixed?