Skip to content
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

[Bug]: Custom tab are not correctly launched #157

Closed
2 tasks done
Wykks opened this issue Feb 26, 2025 · 7 comments
Closed
2 tasks done

[Bug]: Custom tab are not correctly launched #157

Wykks opened this issue Feb 26, 2025 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Wykks
Copy link

Wykks commented Feb 26, 2025

Description

Related to #93 and #33

This lib was soo close to be the one amount the enormous list of lib for the same use case (https://www.reddit.com/r/FlutterDev/comments/16a8jbq/my_head_is_exploding_ive_found_9_different/ , and it's not even a full list..).
Thanks for this, this is almost perfect.

But something is wrong in the way the custom tab is launched in Android. I don't think the flag "FLAG_ACTIVITY_NEW_TASK" should not be used at all, but the way it's done, we have to use it (I get this error without it : Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?).

It's not just a matter of flag, the custom tab is launched in a way that when you check the "recent app screen" (with the smartphone button, or gesture), you can see that the custom tab is not launched on top of the app, but as a "separate app" (or task if it's the correct term). No matter if using FLAG_ACTIVITY_NO_HISTORY or not, it's still showed as a separate app.

Minimal Reproduction

Steps to reproduce the behaviour:

Run the example app, once the login is successfull, try to go back, the custom tab reapear.
If you use ephemeralIntentFlags, this fix the first issue, but you cannot put the app in the background.

No matter what flag you use, the custom tab is shown on the "recent app screen" separately from the app, which is not correct, because you can access the app directly there, bypassing the custom tab, (leaving it open if you don't use FLAG_ACTIVITY_NO_HISTORY).

Exception or Error

N/A

Expected Behaviour

I'm not a Android dev, so I'm not sure what's going on, but I've seen other flutter app (like the Philips Hue app), doing this correctly. You can see when starting the login flow, that the custom tab is not launched separately. You can also put the app in the background and go back to the app and see that the custom tab is still there. If you go back after a successfull login, the custom tab doesn't reappear

Screenshots

The custom tab shown in another "task/activity"
Image

Additional context

No response

Device

Pixel 6

OS

Android

Browser

N/A

Flutter version

3.29.0

flutter_web_auth_2 version

4.1.0

Checklist

  • I have read and followed the entire troubleshooting guide and it has not provided the solution I need.
  • I have provided all the information I can.
@Wykks Wykks added the bug Something isn't working label Feb 26, 2025
@ThexXTURBOXx
Copy link
Owner

Yes, this is something I have been well aware of (sadly). However, there has been very recent progress on this: #156
I have not yet reviewed the PR, but it seems like a promising approach, which I intent to merge and publish as version 5.x.

@Wykks
Copy link
Author

Wykks commented Feb 26, 2025

Ooh interesting, thanks for the quick answer 👍

@Wykks
Copy link
Author

Wykks commented Mar 5, 2025

@ThexXTURBOXx Do you have a rough estimate of when this issue might be resolved? Like next week or next month? Just to know if I can wait, or if I need to do something else. If it's months, no worries, I'll adapt!

Because even with ephemeralIntentFlags, it's a major issue for me in older android versions where ephemeralIntentFlags doesn't work at all 😅

@ThexXTURBOXx
Copy link
Owner

I wanted to test this PR last weekend, but I did not have enough time for that, sadly.
I will try again this weekend, but I cannot promise anything yet

@ThexXTURBOXx
Copy link
Owner

Tested it a few minutes ago and released version 5.0.0-alpha.0. Feel free to test and give feedback! :)

@Wykks
Copy link
Author

Wykks commented Mar 6, 2025

Thanks a lot, I tested it, works great! Completely solve the issue 👍

@Wykks Wykks closed this as completed Mar 6, 2025
@ThexXTURBOXx
Copy link
Owner

Perfect, thank you very much for the feedback! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants