react-native-inappbrowser icon indicating copy to clipboard operation
react-native-inappbrowser copied to clipboard

forceCloseOnRedirection don't work as expected

Open maestor opened this issue 6 years ago • 6 comments

I had mystery problem than Custom Tabs closing automatically if I go to other app. Notice that I had forceCloseOnRedirection value set to true. Actually there is two issues:

  1. I found explanations about this setting in https://github.com/droibit/react-native-custom-tabs: forceCloseOnRedirection boolean undefined Workaround that Custom Tabs doesn't close on redirecting back to app scheme.

That said, force close should happen only if coming back to app from for example oauth registeration flow, not all the time if you go somewhere else from active browser window. Also if you have open link and open active app listing, it shows that inAppBrowser as weird new screen (Honor 9, Android 8) which you can't choose because it disappears. So setting is currently useless (didn't test yet what happens after some redirection if this is set to false, could be that there is no need for keep that at all?).

  1. There is no explanations about settings in this repo README, so had to guess, find from code or try to find comparison setting in libraries mentioned in credits what things should do. This is not nice.

EDIT: Tested one flow with redirection back to app, and for me application opened (and custom tabs closed) succesfully also with forceCloseOnRedirection false, maybe that's unrelevant and confusing setting?

maestor avatar Dec 12 '18 07:12 maestor

@maestor check this discussion ant let me know https://github.com/droibit/react-native-custom-tabs/pull/11

jdnichollsc avatar Dec 12 '18 15:12 jdnichollsc

any pull request to improve the README is always welcome my friend! 👍

jdnichollsc avatar Dec 12 '18 15:12 jdnichollsc

@maestor check this discussion ant let me know droibit/react-native-custom-tabs#11

yeah I have read this, but that doesn't explain why this library's custom tabs will close automatically when app go to background and forceCloseOnRedirection have set to true. that's not redirect use case. I'm not expert about implementation and my Java knowlegde is close to zero so I don't know why this behaviour happening and that's why open new issue 😄

about README and settings part, I can try improving some day, but first have to find some time for researching what all those settings exactly do.

maestor avatar Dec 12 '18 16:12 maestor

The README was updated :)

jdnichollsc avatar Jul 29 '19 15:07 jdnichollsc

Hi, Any update on this issue. Happening on 3.51 too. When app come to foreground the browser is automatically. I have a 2 Factor Authentication so have to put app in background to approve 2FA request.

moizak2000 avatar Jun 24 '21 08:06 moizak2000

Are you reopening the app by pressing app icon?

jdnichollsc avatar Jun 25 '21 21:06 jdnichollsc