-
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
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
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
enableLocationManagerFallback
for 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
LocationManager
withenableLocationManagerFallback=true
when 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 useLocationManager
with 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
LocationManager
fallback.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>