capacitor-community / background-geolocation

A Capacitor plugin that sends you geolocation updates, even while the app is in the background.
MIT License
188 stars 57 forks source link

iOS background location fails and the location stops updating in the foreground. Location icon in the status bar turns hollow. #27

Closed msacchetti closed 3 years ago

msacchetti commented 3 years ago

We have been using v0.3 of this plugin on iOS for months now and it has been working in the background and foreground properly.

All of a sudden, we are experiencing when the app is backgrounded and brought back to the foreground, the location fails and doesn't update - both in the foreground and background. The arrow icon for location in the status bar turns from solid, to outlined/hollow.

The location works fine in the foreground, until it's backgrounded. After it fails when being backgrounded closing and opening the watcher seems to reset it to work again in the foreground.

Does anyone have any ideas on how to debug this?

diachedelic commented 3 years ago

The functionality of the plugin for iOS lives in a single file. You should be able to open it and set breakpoints in Xcode. To find it, go to File->"Open Quickly" and search for Plugin.swift.

Although it may also be some sort of permissions issue. Did you recently upgrade to a newer version of iOS?

diachedelic commented 3 years ago

Did you discover what was going wrong?

msacchetti commented 3 years ago

No it seemed to happen randomly on different phones. Rebuilt the app, reinstalled, etc and it solved it so far.

diachedelic commented 3 years ago

Thanks, please let me know if you discover anything more.

msacchetti commented 3 years ago

Actually we did notice one thing that we fixed in the rebuild. We had this string not matching the capacitor config string.

Our capacitor config had "com.ourapp.trips" and the value we had there was "io.ourapp.trips"

I do not think that was the issue as it had worked for so long with those values and only was failing on a few select devices. But worth noting that at least. tmp_1624586659399~2