Repository navigation
feat: Android location button and getLocationButtonState() - #122
Open
OS-pedrogustavobilro wants to merge 5 commits into
Open
OS-pedrogustavobilro wants to merge 5 commits into
OS-pedrogustavobilro wants to merge 5 commits into
Conversation
OS-pedrogustavobilro
requested review from
alexgerardojacinto,
andredestro,
jcesarmobile,
markemer and
theproducer
November 25, 2026 17:37
OS-pedrogustavobilro
marked this pull request as ready for review
November 25, 2026 17:43
OS-pedrogustavobilro
force-pushed
the
feat/RMET-5199/location-button-plugin
branch
from
November 26, 2026 18:36
38443c0 to
b186fe6
Compare
alexgerardojacinto
left a comment
Contributor
There was a problem hiding this comment.
Review from my AI agent, take it with a grain of salt:
-
GeolocationPlugin.kt:handleOnDestroy()cleanup ordercoroutineScope.cancel()runs beforenativeIslandsController.dispose(). Ifcancel()throws (for example thelateinit var coroutineScopewas never initialised becauseload()failed early),dispose()is skipped and the native views leak.- Fix: call
dispose()first, or wrap both calls intry/finally.
-
GeolocationPlugin.kt:IONGLOCLocationButtonRegistry.register(...)has no matching unregister- The registry is process-global and captures
controllerand::mapButtonErrorCode. After Activity recreation, a new plugin instance registers again. I couldn't tell from the diff whetherregisterreplaces or stacks entries, or whether the oldcontrolleris released. The PR notes cover Activity recreation, so this is probably fine. - Fix: unregister in
handleOnDestroy()if the library offers it, or confirm thatregisterreplaces the previous entry.
- The registry is process-global and captures
-
GeolocationPlugin.kt:mapToErrorInfo()is an exhaustivewhenwith noelse- If a new
IONGLOCExceptionsubtype appears in a futureion-android-geolocationbump, compilation fails. That is useful, but it breaks anyone who resolves a different library version. - Fix: keep it exhaustive and keep the
4.0.0pin strict.
- If a new
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
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
<os-location-button>, Android's system location button, registered when the plugin is imported. It is Android only: on iOS and web the element is hidden. It uses Native Islands project for the native component to be embedded into the web app.getLocationButtonState(), which returnssystem(Android 17+),compat(older Android) orunavailable(iOS and web).test-typescriptjob.Context
Type of changes
Platforms affected
Tests
npm test): the element is hidden and the native state isn't queried outside Android, the web state isunavailable, and the native element registers forsystemandcompat. A failed state read hides the element instead of leaving it undefined.system) and an Android 12 device (compat), here's a list of some of the tests made: