Skip to content

Missing locations while the app is in the background #80

Open
@HarelM

Description

@HarelM

Describe the bug
I'm using this plugin in my app and it generally works great. Thanks for all the effort you put into it!
Having said that, I noticed in my last recording that there was a place where there were no locations updates for 6 minutes when the app was in the background and after that the GPS seems to trying to reposition itself as the accuracy went down from 120 meters to around 10 in a few seconds.
This can be seen in the following image (I was walking on the blue trail):
image
I can share the recoding of this session or the log file my app collected if needed.

My question/request is to understand how to better debug these kind of glitches to better understand what went wrong in this case - was the service killed/stopped/paused? the GPS from the phone stopped sending signals? Capacitor stopped receiving messages? etc...

In some cases the OS kills the app, but it doesn't look like it in this case as the app's log doesn't show boot-up messages.

To Reproduce
Steps to reproduce the behavior:

  1. Start location tracking
  2. Go to the background
  3. Return from background
  4. Expect some GPS signal to be collected while in the background - this doesn't happen all the time, and on a trip of around 3 hours it only happened once, while the app went to the background for multiple times for varying time spans.

Expected behavior
Get locations updates while in the background

Screenshots
See above

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6] Samsung S20
  • OS: [e.g. iOS8.1] Android
  • Browser [e.g. stock browser, safari] chrome webview
  • Version [e.g. 22] 12

Additional context
I think it might prove beneficial to store some logging information in the native code and allow fetching this info when required for better debugging? IDK, any insight and thought will be helpful.
If you think there's something I can push forward in terms of PR please let me know.
This plugin is a core capability of my app and I'm willing to invest the time needed to improve this plugin to better support my needs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions