Closed koviant closed 5 months ago
/similarissues
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Description
Hello,
I'd like to report an issue that I've encountered while using WebAuthenticator from the MAUI Essentials.
In order to open the link in the CustomTabs on Android, WebAuthenticator uses the CustomTabsActivityManager from the Xamarin.AndroidX.Browser nuget. Method CustomTabsActivityManager.From contains the following code:
Due to the static instance field of the manager, it forever holds the reference to the activity that was passed with the first call to that method. The problem happens when this activity was destroyed, and then the app tries to call WebAuthenticator again. CustomTabsActivityManager still holds the reference to the Activity that is no longer in use, and then WebAuthenticator fails to use CustomTabs and fallbacks to the default browser.
I've created a repo where you can reproduce the issue.
Also this issue was discussed in this issue in the Xamarin/AndroidX repository, and as the result of that, the
From
method was marked as obsolete.Steps to Reproduce
Expected result: link is still opened in the CustomTabs Actual result: user is redirected to the browser app, CustomTabs are not open
Link to public reproduction project repository
https://github.com/koviant/DroidWebAuthRepro
Version with bug
8.0.20 SR4
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response