I have an
$ionicPlatform.ready() callback set up in a controller, with the intention of using a cordova plugin once the device is ready. Unfortunately it looks like the callback does not get fired when starting the application initially.
If I navigate away from that state and back, it works. If I wrap the
.ready() call in a
setTimeout of 1.5 seconds it works (any lower and it doesn’t fire). If I manually add an event listener for
deviceready it works as well.
I tried looking at the source but nothing really stood out to me. I wonder if there’s some sort of edge case where the callback list is being emptied before the
deviceready trigger has a chance to run through them. That’s just a shot in the dark, though.
Any help would be appreciated!