-
Notifications
You must be signed in to change notification settings - Fork 8
Enable my location on Android #7
Description
I encountered a problem with enabling 'My Location' on Android devices. It works as expected during the first run on Android device after permission 'When using app' requested and granted by Android OS. The next time app is launched when there is no permission prompt, device location is acquired but no blue circle shown. The click on the MyLocationButton in map top right corner produces only click sound. The location active icon in system area is visible.
Your Sample app behavior is same with one exception: no 'location active' icon in the system area on top while 'MyLocationButton' is shown.
The awkward workaround is to start moving the app into the background using your finger and get it back before completing. It does not matter whether 'Enable My Location' is turned on at that point. After the app is back in focus 'my location' works as expected. Once 'My Location' is enabled, the blue circle appears and clicking MyLocationButton in the top right map corner centers the map on device location. The odd fix might explain why it works after Android permissions prompt. While the prompt has focus, the app is temporarily in the background.
I was testing in Debug, Release and Production mode. No difference. I used Samsung Galaxy S20 running Android 34. I have on the same Galaxy S20 my apps using Mr. Onion library. They don't have that issue.
There is no issue under iOS.