-
Notifications
You must be signed in to change notification settings - Fork 1
feat!: Fallback for no network or Play Services #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This fallback is used if IONGLOCLocationOptions#useLocationManagerFallback is true, and when there is an error in checking location settings / google play services. BREAKING CHANGE: The constructor and some methods of `IONGLOCController` have changed signatures. Updating the library will require changes to fix compilation errors.
1.0.0->2.0.0 because it includes breaking changes References: https://outsystemsrd.atlassian.net/browse/RMET-2991
src/main/kotlin/io/ionic/libs/iongeolocationlib/controller/IONGLOCController.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/io/ionic/libs/iongeolocationlib/controller/IONGLOCController.kt
Show resolved
Hide resolved
src/main/kotlin/io/ionic/libs/iongeolocationlib/controller/helper/IONGLOCFallbackHelper.kt
Show resolved
Hide resolved
Collaborator
|
Tested on Pixel 9 Pro XL (Android 16), Pixel 7 (Android 16), and Pixel 3 XL (Android 12) and it works properly. Using a timeout of 5 seconds I sometimes get a timeout, which is expected, but it still works most of the time - I'm able to get the location, both with |
alexgerardojacinto
approved these changes
Oct 1, 2025
ItsChaceD
approved these changes
Oct 2, 2025
github-actions bot
pushed a commit
that referenced
this pull request
Oct 24, 2025
# 1.0.0 (2025-10-24) * feat!: Fallback for no network or Play Services ([#7](#7)) ([e820114](e820114)), closes [IONGLOCLocationOptions#useLocationManagerFallback](https://github.com/IONGLOCLocationOptions/issues/useLocationManagerFallback) ### Bug Fixes * fix subtitle in README.md ([afc0bb4](afc0bb4)) * fix subtitles in README.md ([148471a](148471a)) * fix subtitles in README.md ([d778351](d778351)) * fix typo in yml file ([765b75d](765b75d)) * fixing typo in README ([7b5fa41](7b5fa41)) * LICENSE file directory in publish-module.gradle file ([3340682](3340682)) * publish library under `io.ionic.libs` instead of `com.capacitorjs` ([1bf7cd8](1bf7cd8)) * Publishing Migration To Central Portal ([#6](#6)) ([60228ff](60228ff)) ### Features * add publish-android workflow to publish Android lib in Maven ([7d33cbe](7d33cbe)) * bring full implementation of library from outsystems-geolocation repo ([0b1362c](0b1362c)) * set workflow_dispatch to manual trigger, avoiding the GitHub action to run when pushing to a branch ([8a1b7be](8a1b7be)) * use semantic-release for library ([53f775e](53f775e)) ### BREAKING CHANGES * The constructor and some methods of `IONGLOCController` have changed signatures. Updating the library will require changes to fix compilation errors. * refactor: Rename new fallback attribute References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * refactor: Extract code to separate methods * fix: Improve `getCurrentLocation` fallback and fix fallback condition References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * chore: update Gradle, AGP, and Android SDK * fix: Fallback Quality based on network connectivity * fix: Use maximumAge in addWatch fallback * fix: Improve use of providers in fallback References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * refactor: Extract methods and classes to separate files References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * chore: Return specific error on no network+location * docs: Document the IONGLOCLocationOptions properties * chore: Prepare to release 2.0.0 1.0.0->2.0.0 because it includes breaking changes References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * chore: remove outdate doc References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * chore: remove irrelevant portion of PR template References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * refactor: minor changes from PR comments References: https://outsystemsrd.atlassian.net/browse/RMET-2991
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
alexgerardojacinto
pushed a commit
that referenced
this pull request
Oct 24, 2025
# 1.0.0 (2025-10-24) * feat!: Fallback for no network or Play Services ([#7](#7)) ([e820114](e820114)), closes [IONGLOCLocationOptions#useLocationManagerFallback](https://github.com/IONGLOCLocationOptions/issues/useLocationManagerFallback) ### Bug Fixes * fix subtitle in README.md ([afc0bb4](afc0bb4)) * fix subtitles in README.md ([148471a](148471a)) * fix subtitles in README.md ([d778351](d778351)) * fix typo in yml file ([765b75d](765b75d)) * fixing typo in README ([7b5fa41](7b5fa41)) * LICENSE file directory in publish-module.gradle file ([3340682](3340682)) * publish library under `io.ionic.libs` instead of `com.capacitorjs` ([1bf7cd8](1bf7cd8)) * Publishing Migration To Central Portal ([#6](#6)) ([60228ff](60228ff)) ### Features * add publish-android workflow to publish Android lib in Maven ([7d33cbe](7d33cbe)) * bring full implementation of library from outsystems-geolocation repo ([0b1362c](0b1362c)) * set workflow_dispatch to manual trigger, avoiding the GitHub action to run when pushing to a branch ([8a1b7be](8a1b7be)) * use semantic-release for library ([53f775e](53f775e)) ### BREAKING CHANGES * The constructor and some methods of `IONGLOCController` have changed signatures. Updating the library will require changes to fix compilation errors. * refactor: Rename new fallback attribute References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * refactor: Extract code to separate methods * fix: Improve `getCurrentLocation` fallback and fix fallback condition References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * chore: update Gradle, AGP, and Android SDK * fix: Fallback Quality based on network connectivity * fix: Use maximumAge in addWatch fallback * fix: Improve use of providers in fallback References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * refactor: Extract methods and classes to separate files References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * chore: Return specific error on no network+location * docs: Document the IONGLOCLocationOptions properties * chore: Prepare to release 2.0.0 1.0.0->2.0.0 because it includes breaking changes References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * chore: remove outdate doc References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * chore: remove irrelevant portion of PR template References: https://outsystemsrd.atlassian.net/browse/RMET-2991 * refactor: minor changes from PR comments References: https://outsystemsrd.atlassian.net/browse/RMET-2991
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR provides a new option
enableLocationManagerFallbackfor using Android Framework's LocationManager, if for some reason using the Fused Provider from GMS is not possible (e.g. device without Play Services).Also using the
LocationManagerwithenableLocationManagerFallback=truewhen there's no network (e.g. device in Airplane mode). Even though Fused Provider technically could work without network (it would just use GPS), the location settings check fails - in this situation we useLocationManagerwith just GPS provider.This PR contains BREAKING CHANGE: The constructor for the controller and some of its methods have changed signature.
Clients will need to change how your application calls the library if you update to this version.
Context
https://outsystemsrd.atlassian.net/browse/RMET-2991
Type of changes
Tests
Use the following application, either from .apk file or build from source code (downloads may take a few seconds to start) - It's the Location Sample App From OutSystems O11 but with code from this PR in the native library.
Testing with airplane mode
If you set the device to airplane mode, it will use the
LocationManagerfallback.Depending on what device you're testing, you may get location timeouts. This is because there is only GPS to access, which may be slower or in some cases only return a location when there's actual movement.
Testing without Play Services
You may test with an emulator and AOSP image (without Play Store). Other than that I saw a "Huawei P40" on sauce labs, but it didn't have Petal Maps installed, the only way I found to properly trigger a new location was via the Sauce Labs Tools to mock a different device location.
Checklist
RNMT-XXXX <title>