question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

location_settings_denied returned while enabling the location.

See original GitHub issue

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:

  1. Turn off your locatoin.
  2. Go to your app that uses this library.
  3. Request to get Locus.getCurrentLocation
  4. Enable location
  5. See error

Expected behavior After enabling the location should retry to get the location instead returning location_settings_denied

Smartphone (please complete the following information):

  • Device: Samsung A70
  • OS: Android
  • Version: Android 11

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ankush-dhimancommented, Jul 1, 2021

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)
                }
            }
0reactions
BirjuVachhanicommented, Oct 8, 2021

@9und70 Great. I’ll release a fix for this soon. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

GetCurrentLocation never returns when location services is ...
When debugging the source code I find that the call to GetBestProvider in Geolocation.android.cs/PlatformLocationAsync method returns the ...
Read more >
How to show enable location dialog like Google maps?
LocationSettingsRequest.Builder has a method setAlwaysShow(boolean show) . While the document indicates it's currently doing nothing(updated 2015-07-05: ...
Read more >
How do I enable notifications and location? - Citizen
We need this information to send you relevant alerts. Go to Settings > Notifications > Citizen, and make sure that Allow Notifications is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found