You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open capacitor app that calls getCurrentPosition()
-> now it should fail because you turned off location services that's okay so far
turn on location services and switch back to your app and run getCurrentPosition() again
-> now the call STILL FAILS even though location services are turned back on
This is because getBestLocation tries to run getLastKnownLocation on the passive provider which returns null, because no other App has requested a Location since you turned Location services back on. If you switch to google maps and request your current location getCurrentPosition starts working again because the Android location service has another location in memory.
The text was updated successfully, but these errors were encountered:
Sadly that's how current implementation works, a possible solution is switching to fused location providers, there is already an issue for it, so going to close this one as duplicate-
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Steps to reproduce:
-> now it should fail because you turned off location services that's okay so far
-> now the call STILL FAILS even though location services are turned back on
This is because getBestLocation tries to run getLastKnownLocation on the passive provider which returns null, because no other App has requested a Location since you turned Location services back on. If you switch to google maps and request your current location getCurrentPosition starts working again because the Android location service has another location in memory.
The text was updated successfully, but these errors were encountered: