When I run this code, the number of calls seems to be limited to about 1000
var i = 1;
$interval(function() {
navigator.geolocation.getCurrentPosition(function(position) {
console.log('Plugin call number', i);
});
i++;
}, 10);
Is there a way to overstep this limit?
Edit 1: This is just an example. In my case, I have custom camera plugin, and one of the method is called at every "pinch in" or "pinch out" event.
Edit 2: When the limit is reached, the app just stops calling the plugin (in this case, it stops at 1004)
Also, the memory usage won't stop growing
Edit 3: It seems that the issue only occurs in Ionic. I've tried this code in a pure Cordova app, and the number of calls doesn't seem to be limited (also the memory usage grows way more slowly)
onDeviceReady: function() {
app.receivedEvent('deviceready');
if (window.cordova) {
var i = 1;
setInterval(function() {
navigator.geolocation.getCurrentPosition(function(position) {
console.log('Plugin call number', i);
});
i++;
}, 10);
}
}