ionic-team/ng-cordova

native geolocation deprecated on Android

開放

#430 建立於 2014年11月11日

 (14 則留言) (0 個反應) (0 位負責人)JavaScript (1,072 個分叉)batch import
help wantedquestion

倉庫指標

星標
 (3,493 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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

貢獻者指南