traccar / traccar-manager-android

Traccar Manager for Android
https://www.traccar.org/manager
Apache License 2.0
246 stars 354 forks source link

Not showing phone position on Android 11 #84

Open sigitm opened 2 years ago

sigitm commented 2 years ago
Screenshot_20210930-094443 Screenshot_20210930-094455

Hi, I installed a Traccar server at home and a gps tracker in my car. I connect to it from my pc (using my personal website address) and my phone.

A useful feature is when I click on the Current Location button (the one with a compass icon) and a blue dot appears with my current position, using phone gps. In this way I can compare my current position and my car position and easily find where my car is parked.

When I use Traccar Manager on my Oneplus Nord phone with Android 11, I cannot see my current phone position. The Current Location button does nothing. In phone settings, Traccar Manager location permission is on, when app is in use (I cannot choose "always").

I tried to install Traccar Manager on an old tablet with Android 7 (using same server, same account, etc.), and it works flawlessly. I see my position when I enable Current Location. In tablet settings, Traccar Manager location permission is always on.

I thinks there's an issue with Android 11 and maybe new permissions system.

tananaev commented 2 years ago

Are you connected to HTTPS server URL?

sigitm commented 2 years ago

Are you connected to HTTPS server URL?

Yes, I am.

tananaev commented 2 years ago

The issue is not with permission. It should be "when app is in use", so that part is correct.

sigitm commented 2 years ago

Don't know what else to check. Does the app provide logs? I tried to look into Logcat while tapping on Current Location, but found nothing relevant about 'traccar' or 'location'.

tananaev commented 2 years ago

The feature is basically provided be the WebView, so there's not much to log. I guess the only option I see is to debug the code (both web and native) to see if all callbacks are getting called.

sigitm commented 2 years ago

I just discovered that if I open Chrome on the phone and connect to my Traccar url, the Current Location button works perfectly: after tapping on it, and allowing the "this site wants to know your location" popup, the blue dot appears.

Therefore, issue is only related to the Traccar Manager app.

At least I can use Chrome as a workaround.