I have troubles with firing immediately subsequent callbacks from a cordova plugin (an iOS one). In XCode debugger I clearly see it steps over
[self.commandDelegate sendPluginResult:pluginResult callbackId:monitoredRegions.callbackId];
several times (in immediate succession), each time with a slightly different pluginResult
.
That gets triggered by
[locationManager requestStateForRegion:region];
which I don't (and can't) control.
The problem is, on the Javascript side, the callback gets fired only once.
What's (actually not so) strange is that if I introduce some blocking in that callback, like alert()
, the callback gets fired several times (as expected). That's cool but I don't need any alert()
in the app.
If I understand it, the commandDelegate
should take care of threading and queueing, but it seems like it doesn't. The question is, how to get the JS callback fired each time sendPluginResult
gets called.
Many thanks!