ionic-team/ng-cordova

native geolocation deprecated on Android

Open

Aperta il 11 nov 2014

Vedi su GitHub
 (14 commenti) (0 reazioni) (0 assegnatari)JavaScript (3493 star) (1072 fork)batch import
help wantedquestion

Descrizione

I struggle to make the geolocation works on Android, using ngCordova and of course the org.apache.cordova.geolocation plugin.

I came across this Jira: https://issues.apache.org/jira/browse/CB-5977

Is ngCordova aware of this deprecation?

What is the best way today to use geolocation on Android with ngCordova? Indeed, it seems that, when the plugin is installed, Android always try to use the native way, that..isn't available any more.

Should I write an ugly pseudo-code like: if(window.cordova && isAndroid()) { useTheBrowserImplementation()} elseif(window.cordova && isIos()) {useNgCordova())} ?

Thanks a lot,

Michael

Guida contributor