You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a beacon feature in a app. I have a total of 80 Beacons.
I currently loading a json file that has all the beacons setup info.
Then, in the code, after the json is loaded, I create a BeaconRegion and add it to an array:
This seems to work on Android... All beacons are successfully added and the motoring starts, ate least some of the 80 beacons were testes and the events onExit e onEnter are fired.
But when the app is run on iOS, the beacons are added, but no events are fired. We made some tests, and added beacons in increments, a group of 5, a group of 10, a group of 15, just for example... and it seems that if we try to add more than 14/15 beacons, then, no events are fired.
The full code is below:
var startListeningBeacons = function ()
{
delegate = new cordova.plugins.locationManager.Delegate();
delegate.didDetermineStateForRegion = function (pluginResult)
{
console.log('Event didDetermineStateForRegion: ' + JSON.stringify(pluginResult));
cordova.plugins.locationManager.appendToDeviceLog('Event didDetermineStateForRegion: ' + JSON.stringify(pluginResult));
};
delegate.didStartMonitoringForRegion = function (pluginResult)
{
console.log('Event didStartMonitoringForRegion:', pluginResult);
console.log('Event didStartMonitoringForRegion:' + JSON.stringify(pluginResult));
};
delegate.didRangeBeaconsInRegion = function (pluginResult)
{
console.log('Event didRangeBeaconsInRegion: ' + JSON.stringify(pluginResult));
};
delegate.didEnterRegion = function (pluginResult)
{
//DO SOMETHING WITH THE BEACON INFO
//callNotificationPush(pluginResult, 1);
console.log('Event didEnterRegion: ' + JSON.stringify(pluginResult));
};
delegate.didExitRegion = function (pluginResult)
{
//DO SOMETHING WITH THE BEACON INFO
//callNotificationPush(pluginResult, 2);
console.log('Event didExitRegion: ' + JSON.stringify(pluginResult));
};
createBeacons().then(function()
{
cordova.plugins.locationManager.setDelegate(delegate);
cordova.plugins.locationManager.requestAlwaysAuthorization();
console.log("Mono");
});
};
var createBeacons = function ()
{
console.log("ENTROU NO CREATE BEACONS");
var beaconsDataLength = beaconsData.length;
var arrayBeacons = [];
var counterFail = 0;
var counterDone = 0;
return new Promise(function (resolve, reject)
{
for (i = 0; i < beaconsDataLength; i++)
{
if (checkUUIDBeacon(beaconsData[i].UUID))
{
try
{
var beaconRegion = new cordova.plugins.locationManager.BeaconRegion
(
beaconsData[i].Identifier,
beaconsData[i].UUID,
beaconsData[i].Major,
beaconsData[i].Minor,
beaconsData[i].notifyEntryStateOnDisplay
);
arrayBeacons.push(beaconRegion);
}
catch (error)
{
console.log("error create beacon", error);
}
}
else
{
console.log("NAME: " + beaconsData[i].Identifier + "UUID: " + beaconsData[i].UUID)
}
}
var arrayBeaconsLength = arrayBeacons.length;
for (var j = 0; j < arrayBeaconsLength; j++)
{
var beacon = arrayBeacons[j];
cordova.plugins.locationManager.startMonitoringForRegion(beacon)
.fail(function (e)
{
console.log("error add beacon: " + e);
++counterFail;
checkAsyncAddBeaconsComplete(counterFail, counterDone, arrayBeaconsLength, resolve);
})
.done(function (e)
{
console.log("added beacon: " + e);
++counterDone;
checkAsyncAddBeaconsComplete(counterFail, counterDone, arrayBeaconsLength, resolve);
});
}
});
};
var checkUUIDBeacon = function (uuid)
{
var regex = new RegExp(/^[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}$/i);
return regex.test(uuid);
}
var checkAsyncAddBeaconsComplete = function (countFail, countDone, countTotal, callback)
{
if ((countFail + countDone) == countTotal)
{
callback();
console.log("All beacons with no errors as been added.");
}
}
Expected behavior and actual behavior.
Add 80 beacons all get events from all the beacons. Actually on iOS it seems there's some king of limite to the total number of beacons that are monitored.
Steps to reproduce the problem.
Add a bunch of beacons. If we only add one (1, 2, 3... maybe 13/14 at max) it works on Android and iOS with the same code base.
cordova-android version
Cordova 8.1.2 and Android 8.1.0
cordova-ios version
Cordova 8.1.2 and and iOS 5.0.1
cordova-plugin-ibeacon version
3.8.1
If running on a device, device model and os version.
iPhone SE 2nd (ios 14 updated)
The text was updated successfully, but these errors were encountered:
I'm trying to implement a beacon feature in a app. I have a total of 80 Beacons.
I currently loading a json file that has all the beacons setup info.
Then, in the code, after the json is loaded, I create a BeaconRegion and add it to an array:
After all the Beacons Objects have been created I add them to the plugin motoring service:
This seems to work on Android... All beacons are successfully added and the motoring starts, ate least some of the 80 beacons were testes and the events onExit e onEnter are fired.
But when the app is run on iOS, the beacons are added, but no events are fired. We made some tests, and added beacons in increments, a group of 5, a group of 10, a group of 15, just for example... and it seems that if we try to add more than 14/15 beacons, then, no events are fired.
The full code is below:
Expected behavior and actual behavior.
Add 80 beacons all get events from all the beacons. Actually on iOS it seems there's some king of limite to the total number of beacons that are monitored.
Steps to reproduce the problem.
Add a bunch of beacons. If we only add one (1, 2, 3... maybe 13/14 at max) it works on Android and iOS with the same code base.
cordova-android version
Cordova 8.1.2 and Android 8.1.0
cordova-ios version
Cordova 8.1.2 and and iOS 5.0.1
cordova-plugin-ibeacon version
3.8.1
If running on a device, device model and os version.
iPhone SE 2nd (ios 14 updated)
The text was updated successfully, but these errors were encountered: