Use navigator.geolocation or $cordovaGeolocation in Ionic

前端 未结 3 1811
旧时难觅i
旧时难觅i 2020-12-21 03:49

Since I basically can get the same info with both approaches, I\'m wondering which is the preferred one and what are the advantages using one over the other?

3条回答
  •  一生所求
    2020-12-21 04:24

    As far as I remember, on Android that plugin does not do anything at all, and on iOS it prevents the OS asking for access to location over and over.

    Overall the plugin totally conforms the html5 specs, so you shouldn't change anything in your calling code (in js) if you use the plugin.

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

提交回复
热议问题