Comments (8)
Nope, just navigate to another screen of your app once you've been redirected by the OAuth flow.
Something like:
componentDidMount() {
Linking.addEventListener('url', this._authorize);
}
async _authorize(options) {
// handle url with options.url, for example parse the parameters to get the authorization code
// navigate to your app's home screen
}
from react-native-custom-tabs.
Hi @ataillefer
I'm trying to do that, however the listener is not triggered until I close the tab myself.
I'm using Wix's navigation if that helps.
from react-native-custom-tabs.
I have this issue. You can't navigate in the background with v1 (maybe v2 too?) in the Wix navigation library. It just flat out fails. I dug into that a while back and found out the current activity reference they have is null when in the background and their navigation just noops. (enjoy - https://github.com/wix/react-native-navigation/blob/v1/android/app/src/main/java/com/reactnativenavigation/controllers/NavigationCommandsHandler.java)
When the custom tab is open, the app is in 'background' state, thus you can't navigate if using Wix (v1 at least). However, it does fire the 'appLaunched' event and you can call 'startApp' again. Unfortunately though, that means you'd have no access to the parameters from the redirect.
FYI forceCloseOnRedirection does nothing in this case.
I am surprised a bigger fuss hasn't been made about this considering RNN is one of the most popular React Native navigation libraries.
from react-native-custom-tabs.
I get that. But the user is still on the browser screen right?
from react-native-custom-tabs.
Well no, if you navigate to another screen of your app then you are no more on the Chrome Custom Tab.
from react-native-custom-tabs.
@ataillefer and if you want the user to stay on the screen that launched the new tab? Is there a way to close it?
from react-native-custom-tabs.
Close it, technically, no, but in the _authorize
callback from the sample given in #22 (comment), just use setState
to rerender the current screen with any React Native components.
from react-native-custom-tabs.
Hi Devs.. Anyone found any workaround to close custom tab once we redirect to our app?
Thanks in advance
from react-native-custom-tabs.
Related Issues (20)
- Pre-starting / Pre - feching in react native chrome custom tab
- Not working in React Native 0.56 HOT 1
- Bump version and publish on npm
- React Native 0.56+ android build failure
- package com.github.droibit.android.reactnative.customtabs does not exist HOT 2
- Is there a way to know that user got back to the app? HOT 1
- Is there a way to add a custom menu item?
- Adding support for SafariView for iOS HOT 1
- Is there any way to create a callback function on attempt to close the custom tab?
- Typescript support
- Podspec needed for RN0.60 HOT 2
- Path or configuration is wrong when compiling project to ios HOT 2
- React custom tabs component crashing Xcode
- Navigation is blocked
- Cannot find symbol CustomTabsIntent HOT 1
- Still maintained? HOT 3
- Build failing on `import android.support.customtabs.CustomTabsIntent`
- openURL fails on ios HOT 3
- Support new React Native new architecture
- upgrade reac-native to 0.71.6,an error occurred HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-custom-tabs.