transistorsoft / cordova-background-geolocation-lt

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
http://www.transistorsoft.com/shop/products/cordova-background-geolocation
Other
661 stars 276 forks source link

Ios logs gaps during movement #1306

Closed Vasek18 closed 2 years ago

Vasek18 commented 3 years ago

Your Environment

Expected Behavior

2 walks further 500 meters: 14.09.2021 12:40-22:00 and 15.09.2021 10:55-11:35 should be tracked

Actual Behavior

As you can see there are no logs during this periods. Also we've got no locations on a server. It worth to mention that device had no internet connection during the periods

Steps to Reproduce

  1. Turn tracking on or trigger it by schedule
  2. Turn off internet connection
  3. Go on a walk for ~1km

Context

We remember about your advice to increase stopTimeout parameter (it is being tested now). But could the stopTimeout be the only reason for this silence? Or does the plugin requires internet connection to work?

Debug logs

Logs ``` I've attached them as a file due to maximum characters constrain ```

background-geolocation (10).log.gz

christocracy commented 3 years ago

not a Cordova-based project, Capacitor

Why are you not using capacitor-background-geolocation instead? It is the same native libraries "under the hood" and is not a cause of tracking issues but you should use the Capacitor version with Capacitor projects.

christocracy commented 3 years ago

Turn off internet connection

How exactly are you "turning off internet connection". If you're turning off Wifi, that is your problem, since both iOS and Android use Wifi signals to fire geofences. The plugin uses a geofence around the last known position in order to determine that the device is moving when the EXIT event fires (typically after ~200 meters of movement).

Vasek18 commented 3 years ago

Why are you not using capacitor-background-geolocation instead? It is the same native libraries "under the hood" and is not a cause of tracking issues but you should use the Capacitor version with Capacitor projects.

We've started to use current library at May. It was before you've created separate one for Capacitor. Now it looks like a big risk to replace it

How exactly are you "turning off internet connection". If you're turning off Wifi, that is your problem, since both iOS and Android use Wifi signals to fire geofences.

So should wi-fi always be turned on? Wouldn't it cause battery drains?

The plugin uses a geofence around the last known position in order to determine that the device is moving when the EXIT event fires (typically after ~200 meters of movement).

Doesn't physical activity monitor help to determine that the device is moving?

christocracy commented 3 years ago

Now it looks like a big risk to replace it

What sort of "risk" do you think there is? Is is the exact same native iOS / Android libraries used in all versions of the plugin for Cordova, Capacitor, React Native and Flutter. There is no difference in plugin behaviour.

So should wi-fi always be turned on?

Yes.

Wouldn't it cause battery drains?

No.

Doesn't physical activity monitor help to determine that the device is moving?

iOS disallows the MotionAPI to operate in the background unless location is currently being monitored in the background. Location API is not turned on until the plugin's stationary geofence EXIT event fires. Geofences won't fire in the typical 200 meters unless Wifi is ON. If Wifi is OFF, the device will have to travel at least 1000 meters before the geofence exit fires.

DO NOT TURN OFF WIFI.

Vasek18 commented 3 years ago

What sort of "risk" do you think there is? Is is the exact same native iOS / Android libraries used in all versions of the plugin for Cordova, Capacitor, React Native and Flutter. There is no difference in plugin behaviour.

If there is no difference what is the point for us to change plugin?

DO NOT TURN OFF WIFI.

Ok, thanks, we've heard you

christocracy commented 3 years ago

If there is no difference what is the point for us to change plugin?

You will eventually encounter build issues (eg: when new iOS / Android versions are released). I'm no longer interested in supporting the Cordova version with Capacitor apps.

The next time you have a build issue with the Cordova version, I'm simply going to say "Sorry, I suggest you migrate to the Capacitor version".

Vasek18 commented 3 years ago

Hi,

Do we need to generate a new license key if we migrate to capacitor's plugin?

christocracy commented 3 years ago

Cordova Background Geolocation keys do not work with Capacitor Background Geolocation.

Vasek18 commented 3 years ago

Does this mean that we should purchase new license or we can just generate new key at Customer Dashboard?

christocracy commented 3 years ago

It means you need to purchase a Capacitor license.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale[bot] commented 2 years ago

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.