AppAuth-Android icon indicating copy to clipboard operation
AppAuth-Android copied to clipboard

Custom tab closes when user switches apps

Open ricalo opened this issue 10 years ago • 3 comments

I just ran into this problem. Basically, my service uses 2FA, which makes the users switch to another app to approve the request. The custom tab is finished as soon as the user moves away from it. The reason is that the intent is created with FLAG_ACTIVITY_NO_HISTORY. I understand there are reasons to use that flag, but it creates a problem when users need to switch to another app to continue.

Is there a workaround for this?

This was first reported in #105, but it was closed without much chance to discuss.

ricalo avatar Sep 20 '16 20:09 ricalo

It's something I'd have to investigate in more detail. It seems odd that the 2FA flow is closing the custom tab; I would have thought that the tab would have to be explicitly dismissed by the user or the app to disappear from the context of that task.

iainmcgin avatar Sep 21 '16 20:09 iainmcgin

OK, just tried playing around with this. If FLAG_ACTIVITY_NO_HISTORY is not set, then in the demo app pressing back after authorization in the custom tab brings that custom tab back. I'll see if there is a way to force that custom tab activity to finish(), which I think would have the desired effect without using NO_HISTORY.

iainmcgin avatar Sep 22 '16 00:09 iainmcgin

This is now fixed by #109.

iainmcgin avatar Sep 27 '16 20:09 iainmcgin