react-native-custom-tabs icon indicating copy to clipboard operation
react-native-custom-tabs copied to clipboard

Dismiss custom tabs

Open edo1493 opened this issue 8 years ago • 5 comments

I am not sure, but I guess there is no way to dismiss custom tabs, right? I just want dismiss it programmatically from RN.

edo1493 avatar Sep 13 '17 10:09 edo1493

Don't think so, but why would you want to do this?

ataillefer avatar Sep 13 '17 19:09 ataillefer

I am using it for a OAuth login flow, so I would like to close the view, once the user has logged in.

I can still do it cause I have an intent that listens to a deep link, so the custom tabs view is shutdown, when the login is successful.

edo1493 avatar Sep 14 '17 10:09 edo1493

Yes that's the way, by handling the OAuth redirect URL with a listener that finally navigates to the another view once the flow is done, typically your app's home view:

componentDidMount() {
  Linking.addEventListener('url', this._handleOAuthRedirectURL);
}
...
_handleOAuthRedirectURL(options) {
   // do domething with options.url
   ...
   // navigate to the home view
}

ataillefer avatar Sep 14 '17 12:09 ataillefer

I'm working on a project which is just an app in a Webview utilising this package for OAuth authentication. How would one go about dismissing the custom tabs in this case?

petlys avatar Mar 19 '18 12:03 petlys

Yes that's the way, by handling the OAuth redirect URL with a listener that finally navigates to the another view once the flow is done, typically your app's home view:

componentDidMount() {
  Linking.addEventListener('url', this._handleOAuthRedirectURL);
}
...
_handleOAuthRedirectURL(options) {
   // do domething with options.url
   ...
   // navigate to the home view
}

Do you know how to handle this when the the app with chrome-tabs is in the background? In that case the Linking event never seems to be fired.

rsjolundchas avatar Sep 13 '19 07:09 rsjolundchas