Skip to content

fix: Return error when user does not turn on location#12

Merged
OS-pedrogustavobilro merged 3 commits into
mainfrom
fix/no-location-enable-fallback
Jun 15, 2026
Merged

fix: Return error when user does not turn on location#12
OS-pedrogustavobilro merged 3 commits into
mainfrom
fix/no-location-enable-fallback

Conversation

@OS-pedrogustavobilro

@OS-pedrogustavobilro OS-pedrogustavobilro commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes a bug that was causing the IONGLOCRequestDeniedException to not be returned to the consumer when enableLocationManagerFallback=true.

The issue this was causing is as follows:

  1. User has location turned off on the phone (I don't mean permission not granted, I mean turned off location in the device e.g. via the quick settings panel / notification center)
  2. A location request is called that reaches this library
  3. The library calls a request to enable the location on the device - native system UI dialog shown to user
  4. The user rejects to turn on the location

Prior to this PR, with enableLocationManagerFallback=true, the library was still trying to retrieve the location, causing the method to hang until timeout. Now, the correct IONGLOCRequestDeniedException is propagated outwards (as it was already with enableLocationManagerFallback=false.

The PR also has some minor fixes on formatting and fixing an Android Studio warning.

Context

Discovered while working on https://outsystemsrd.atlassian.net/browse/RMET-5198, although not related to that task.

It's likely this is a bug introduced in 2.0.0 when enableLocationFallback was introduced.

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Tests

Refer to the unit test I had that confirms the behavior is now fixed.

To test with an actual app, refer to this OutSystems O11 apk where the issue is fixed: https://drive.google.com/file/d/1HjjVgCTuxLGLuAKL_hZG_9mRMMIB_GXe/view?usp=sharing

To compare the behavior previously, feel free to repeat steps 1-4 with any other app that uses the location plugin (be it OutSystems or Capacitor) - E.g. the ODC one

Checklist

  • Code follows code style of this project
  • CHANGELOG.md file is correctly updated
  • Changes require an update to the documentation
    • Documentation has been updated accordingly

@alexgerardojacinto

Copy link
Copy Markdown
Collaborator

Tested with Pixel 9 Pro XL and everything seems to work well, approving!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants