Ionic.Platform.ready Regression?


#1

I’m using the phonegap geolocation plugin through navigator.geolocation.getCurrentPosition, which requires cordova to be loaded before it works. To make sure cordova loaded, I wrap the geolocation call in ionic.Platform.ready(function(){}). Wrapping the geolocation call in this function ensures that, on iOS, the geolocation permissions dialogue says

"App" would like to use your location
rather than
var/www/[gibberish] would like to use your location

Recently, I updated to 0.9.26 and that has caused two issues:

  1. The ugly geo permissions dialogue is back in iOS
  2. On android, any code inside the ionic.Platform.ready(function(){}) callback won’t fire

Can anyone confirm a change in the behavior of ionic.Platform.ready?


#2

I think you need to be using $ionicPlatform like :

$ionicPlatform.ready(function() {
 ....
});

I’m able to use that in 0.9.25 and 0.9.26.


#3

yeah, I’m having the same issue …

is right …
as per doco enter link description here

ionic.Platform.ready(function(){})

wont recognise this …

$ionicPlatform.ready(function() {

});


#4

b.t.w.

I’ve implemented Brians solution … but still have issues…

http://briantford.com/blog/angular-phonegap.html


#5

I’m using 9.27 and ionic.Platform.ready is working for me
I use it to init for google maps api.