Open edo1493 opened 7 years ago
Don't think so, but why would you want to do this?
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.
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
}
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?
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.
I am not sure, but I guess there is no way to dismiss custom tabs, right? I just want dismiss it programmatically from RN.