Code Monkey home page Code Monkey logo

Comments (8)

ataillefer avatar ataillefer commented on September 26, 2024 1

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.

NicolasBonduel avatar NicolasBonduel commented on September 26, 2024 1

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.

dev6james avatar dev6james commented on September 26, 2024 1

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.

RichardLindhout avatar RichardLindhout commented on September 26, 2024

I get that. But the user is still on the browser screen right?

from react-native-custom-tabs.

ataillefer avatar ataillefer commented on September 26, 2024

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.

ianataffinity avatar ianataffinity commented on September 26, 2024

@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.

ataillefer avatar ataillefer commented on September 26, 2024

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.

aithashi avatar aithashi commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.