Skip to content

Add support for ActivityResultRegistry in BrowserSwitchClient#127

Merged
saperi22 merged 12 commits intomainfrom
test-authtab-compat
Mar 3, 2026
Merged

Add support for ActivityResultRegistry in BrowserSwitchClient#127
saperi22 merged 12 commits intomainfrom
test-authtab-compat

Conversation

@saperi22
Copy link
Copy Markdown
Collaborator

Summary of changes

  • Add a new constructor to BrowserSwitchClient to take in an ActivityResultRegistry.

Checklist

  • Added a changelog entry

Authors

List GitHub usernames for everyone who contributed to this pull request.

@saperi22 saperi22 requested a review from a team as a code owner February 12, 2026 05:21
@saperi22 saperi22 changed the title Test authtab compat Add support for ActivityResultRegistry in BrowserSwitchClient Feb 25, 2026
@noguier
Copy link
Copy Markdown
Contributor

noguier commented Mar 2, 2026

I tested the flow and it looks like everything is working correctly! Just a question, I noticed BrowserSwitchClient is created directly in the composable body without remember. Will there ever be a chance where the recomposition happens and messes up the flow? If so should we use remember just in case?

@saperi22
Copy link
Copy Markdown
Collaborator Author

saperi22 commented Mar 2, 2026

I tested the flow and it looks like everything is working correctly! Just a question, I noticed BrowserSwitchClient is created directly in the composable body without remember. Will there ever be a chance where the recomposition happens and messes up the flow? If so should we use remember just in case?

I haven't put much thought into it since it is in the demo app.

Copy link
Copy Markdown

@saralvasquez saralvasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested everything and it works as normal. Just had a small question for my own knowledge

when (val startResult = browserSwitchClient.start(this, browserSwitchOptions)) {
is BrowserSwitchStartResult.Started -> {
PendingRequestStore.put(this, startResult.pendingRequest)
MainContent()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes here make sense to me, but can I ask why you pulled everything into MainContent? Is it just to adhere to compose best practices better?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, great one.
For compose testing, I wanted to test if we can not rely on the lifecycle methods provided by activity and instead handle everything within compose.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhhhhh! Ok yeah that makes a ton of sense. I remember us talking about the lifecycle struggles between activity and compose. Cool

@saperi22 saperi22 merged commit ef97f95 into main Mar 3, 2026
4 checks passed
@saperi22 saperi22 deleted the test-authtab-compat branch March 3, 2026 21:45
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.

4 participants