Use navigator.geolocation or $ cordovaGeolocation in Ionic

Since I can basically get the same information with both approaches, I wonder which one is preferable and what are the advantages of using one over the other?

+4
source share
3 answers

It should be noted that in accordance with current and official documentation (see

+1
source

$cordovaGeolocation angular javascript, ionic. , ngCordova , - .
Pratical angular. , $scope .
:

promises, .

, : $cordovaGeolocation.

+5

, Android , iOS .

In general, the plugin fully complies with the html5 specifications, so you should not change anything in your code code (in js) if you use the plugin.

And the plugin has good documentation here: https://github.com/apache/cordova-plugin-geolocation/blob/master/doc/index.md

+2
source

All Articles