Closed kosratdev closed 3 years ago
@kosratdev It is supposed to retrieve location updates. location_settings_denied
is thrown if it could verify that the location is enabled.
@BirjuVachhani The library requests to open the device's location when enabled from the library dialog it returns location_settings_denied
@kosratdev That's correct but it should only return that if something is not right. Could you please verify this on Android devices other than Samsung because I tried to replicate the same on the emulator but it worked fine. Maybe that will be helpful to narrow down the issue to specific devices/OS.
Just I have checked it, it works for the emulator but on my Samsung device doesn't work I don't know why. I will try to test it on another physical device
@kosratdev I thought that might be the case. I do not own any Samsung devices but I would love to get some more info on this. Maybe you could share the stacktrace/logs for this from the Samsung device? Also, there might be chances that this may work just fine for some Samsung devices. So if you have any other around, please test on them as well.
Hey, I'm facing the same issue as well. When I use getCurrentLocation()
and have my location turned off, it requests for turning on the location as expected, however, once I do turn on the location, it fails with exception in log com.google.android.gms.common.api.ResolvableApiException: 6: RESOLUTION_REQUIRED
i.e. It is unable to resolve that I have actually granted the location & hence start getting the current location. Ideally, once I turn on the location, it should proceed forward with giving me the current location automatically instead of throwing above exception. Testing device is a Lenovo K10 Note running Android Pie.
Any help is appreciated! 😄
This seems weird. Everything seems to be working fine when I test it on an emulator. Will try to check with a real device.
Any update about this issue ?
I tested it on Samsung S20 (Android 11) on Browser stack and it seems to be working fine. Can anyone provide me a video or anything like that?
I was facing same issue, So I made some changes in library. Now It is working fine for me. Tested (Eabled/Disabled GPS and Handled it based on resultCode.
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE_LOCATION_SETTINGS) {
if (resultCode == RESULT_OK) {
shouldProceedForLocation()
}
else {
checkSettings(success = { shouldProceedForLocation() }) {
postResult(Constants.LOCATION_SETTINGS_DENIED)
}
}
I was facing same issue, So I made some changes in library. Now It is working fine for me. Tested (Eabled/Disabled GPS and Handled it based on resultCode.
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == REQUEST_CODE_LOCATION_SETTINGS) { if (resultCode == RESULT_OK) { shouldProceedForLocation() } else { checkSettings(success = { shouldProceedForLocation() }) { postResult(Constants.LOCATION_SETTINGS_DENIED) } }
If this is working for everyone then I'll make required changes and publish a new version.
Can anyone check on this dependency this and confirm here? I have applied @ankush-dhiman's solution on this. If this works then I'll release a version.
implementation 'com.github.BirjuVachhani:locus-android:master-SNAPSHOT'
@kosratdev Did you get a chance to check this?
Can anyone check on this dependency this and confirm here? I have applied @ankush-dhiman's solution on this. If this works then I'll release a version.
implementation 'com.github.BirjuVachhani:locus-android:master-SNAPSHOT'
It works on a Samsung Galaxy Tab A SM-T510
@9und70 Great. I'll release a fix for this soon. Thanks!
Describe the bug When the device's location is turned off then the app requests to enable location after you enable it, it will return
location_settings_denied
To Reproduce Steps to reproduce the behavior:
Locus.getCurrentLocation
Expected behavior After enabling the location should retry to get the location instead returning
location_settings_denied
Smartphone (please complete the following information):