Hello people! I’m sorry in advance for my English… but I will try to make understandable sentences.
I’m new from this week to Ionic and it’s awesome! However, I have a problem.
I want to get the geolocation of the user each hour and with a precision of 500m. And if it’s possible, without the activation of the GPS. (As the NETWORK_PROVIDER with Android). Unfortunately, I didn’t found the solution.
I tried this plugin: https://github.com/mauron85/cordova-plugin-background-geolocation with the two providers ANDROID_DISTANCE_FILTER_PROVIDER and ANDROID_ACTIVITY_PROVIDER.
The first one (ANDROID_DISTANCE_FILTER_PROVIDER) is great but the stationaryRadius check every minute if the smartphone is still in the radius. (I tried with this:
desiredAccuracy: 1000, stationaryRadius: 800, distanceFilter: 800, LocationProvider: 0, debug: true, interval: 3600000).
So, I tried the second (ANDROID_ACTIVITY_PROVIDER). It works very well, every hour the application send me the geolocation of the user. However, when the smartphone is locked, nothing is send! (Contrary to the first provider…) (config :
stationaryRadius: 100, //not needed however doesn't work if I don't specify it
fastestInterval : 3600000,
startForeground: false )
I’m currently asking me what I should do. Use the BackgroundMode plugin and try to get the geolocation with the Geolocation plugin?
This plugin https://github.com/dpa99c/cordova-plugin-request-location-accuracy talk about “REQUEST_PRIORITY_BALANCED_POWER_ACCURACY”. Is it possible to get the geolocation with it ?
Or I must develop natively the android app?
Thanks a lot for everything and have a good day !