Skip to content

v2.2.1 — Android Permission Dialog Hotfix (#53)

Choose a tag to compare

@vietnguyentuan2019 vietnguyentuan2019 released this 23 Jun 09:44

Grant v2.2.1

Patch release fixing #53 — on Android the system permission dialog never opened, while iOS worked fine. Affected v2.1.0 and v2.2.0.

Root cause

Since v1.4.3, the Android request() path required a GrantLauncher registered via setLauncher(). When no launcher was registered, the request silently returned DENIED without ever showing the system dialog. This also contradicted the library's "No Lifecycle Binding" promise — setLauncher() was never documented in the README.

Fix

  • When no launcher is registered, request() now falls back to the library's self-contained transparent GrantRequestActivity (already shipped in grant-core's manifest), so the dialog opens from any context (ViewModel, Repository, etc.) with zero lifecycle binding.
  • setLauncher() remains an optional optimization for apps that prefer driving the dialog through their own ActivityResultLauncher.
  • Aligned the multi-request timeout with the single-request path (5 min, was 60s).
  • Documented Android behavior + setLauncher() in the README.
  • New regression test: Issue53NoLauncherFallbackTest.

See #54 for the full fix.

Upgrading

No code changes required — just bump the version:

implementation("dev.brewkits:grant-core:2.2.1")