Skip to content

[various] Allow resuming pending authorization after activity recreation on Android#669

Open
moritz-j wants to merge 4 commits into
MaikuB:masterfrom
BrickmakersGmbH:fix/android_resume_auth
Open

[various] Allow resuming pending authorization after activity recreation on Android#669
moritz-j wants to merge 4 commits into
MaikuB:masterfrom
BrickmakersGmbH:fix/android_resume_auth

Conversation

@moritz-j

Copy link
Copy Markdown

We have encountered an issue where the auth response is not handled after returning from the browser back to the app. This happens when the app's Activity is killed by Android (e.g. for clearing up memory). This PR adds a resumePendingAuthorization() method that allows the app to get the "missed" auth response after reinitialising itself.

Steps to reproduce:

  1. Enable "Don't keep activities" in Android developer settings.
  2. Start auth flow.
  3. Complete authentication.

=> Browser closes, but app doesn't receive the auth response.

Behaviour with fix:

  1. Browser auth flow started
  2. Activity killed in background
  3. Browser flow finishes
  4. Activity is recreated and flutter reinitialized
  5. App calls resumePendingAuthorization() and receives response
  6. User logged in

moritz-j added 4 commits July 17, 2026 11:22
- for auth with and without code exchange
- only when receiving activity result with no pending operation, i.e. when no Result is available to send auth result to flutter
- preserves null intent error because then no data is available to store
takes pending authorization data and returns it to new Result
afaik there is no scenario this can happen on iOS or macOS
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.

1 participant