I am building a Cordova app that will run on android and ios (windows phone would be a plus).
I am having trouble finding a reliable way to get the geolocation coordinates of the device.
I have been using this API: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation
I have also used this Cordova plugin: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-geolocation/
The plugin says that it is based on the W3C Geolocation API. I am finding that these are not very robust and reliable ways of getting the location. It’s not clear if the libraries eventually interface with the hardware or not.
I wrote a small native Java app that runs on Android and it was able to find my coordinates within 4 seconds. Native apps always interface with the hardware more closely so it makes sense that it would be more robust.
I am not seeing a lot of Cordova plugins that interface with native without going through this W3C API first.
I found some but they are not cross-platform: https://www.npmjs.com/package/cordova-plugin-advanced-geolocation
Is it very difficult to write a plugin for just listening to the location updates?
Are there any reliable methods?