CustomTabs activity closes when app is paused/resumed
I've been working on a xamarin app that is implementing a standard oauth2 flow which includes sending a login code to some users via sms.
The problem is that the current appauth implementation always seems to close the customtabs windows upon returning the to app, which means a user will not be able to go get the code from their messaging app and then come back to our app to finish the login.
This is reproducible with the sample app (I used the Xamarin version, but I assume the same holds for the sample in this repository).
Steps:
- load Android AppAuth sample
- tap login (browser customtab opens in app)
- tap device's app switch button
- tap back into appauth and see the browser is closed.
Is this expected/known behavior? Is there some work-around that works for two-factor authentication scenarios? I've been trying to track down why it works this way for over a day with no luck.
The Xamarin demo you are referencing is not the same as the demo here, I wasn't even aware of it until you linked to it. Our own demo app does not have the issue you describe; you can see a screen recording of it that I just made here. Looking at the Xamarin demo, it is using 0.4.0 of AppAuth, which likely predates the changes we made to deal with the issue you are describing; we have much more robust handling of the back stack and custom tabs now.
Thanks for the quick response. I'm happy to see this issue is resolved in the latest version, and I definitely didn't realize the Xamarin binding/nuget wasn't being kept up to date. I will look at updating that binding project.
On that note - have you considered adding Xamarin binding projects to this repository, or helping maintain the ones Microsoft has?
I've confirmed this works properly after rebuilding the Xamarin binding project with AppAuth.aar v6.1
I don't know enough about Xamarin to be a competent maintainer, but I'll try and get in touch with the maintainers on that end to collaborate more closely.