Coder Social home page Coder Social logo

Comments (7)

helixbass avatar helixbass commented on April 16, 2024 9

@ericvicenti I was attempting to use your suggested solution of using Linking.openURL() (use case is navigating to a specific screen when a push notification is opened) but seem to have run into the issue that when using Linking.openURL() with a universal link (as opposed to a custom-protocol deeplink URI), iOS doesn't allow the app itself to handle the universal link (so Linking.openURL() opens Safari)

So for now am going to just manually recreate the existing uriPrefix/path navigation logic by parsing the universal link URL, but am curious how hard it'd likely be to add an OpenURI action, as it may be worth investing in that option as the number of universal link types on this project grows?

from react-navigation.

marlonoso avatar marlonoso commented on April 16, 2024 2

I'm wondering how can we open a link from a navigator entry. Like:

const Home = DrawerNavigator(
  {
    Account: { screen: Account },
    Availability: { screen: Availability },
    Favorites: { screen: Favorites },
    Website: { screen: Linking.openURL('http://www.example.com') },
  }, 

from react-navigation.

netgfx avatar netgfx commented on April 16, 2024 2

Is there a solution to this then? Can we add a Linking.openURL directly on the drawer screen property? Because right now it crashes my App

from react-navigation.

ericvicenti avatar ericvicenti commented on April 16, 2024 1

@marlonoso, With the current API, you'd be best off by implementing your own drawer content component.

There are a bunch of hacks you could do, like using a dummy component and then overriding the router getStateForAction behavior to intercept the navigate request and do something different, but you might run into some issues with that.

But there are certainly a few ways we could improve this. If you'd like to propose a better API, feel free to open up a detailed RFC issue.

from react-navigation.

mkonicek avatar mkonicek commented on April 16, 2024

Hey, can you please explain 'manually navigate'? Can you share a code example? Have you checked the linking example here?
https://github.com/react-community/react-navigation/tree/master/examples

from react-navigation.

markflorisson avatar markflorisson commented on April 16, 2024

Yes, I mean can we open a deeplink from within the app without having to parse it? I realize this is not a common usecase (we can always represent dynamic links within the app in a more convenient format than a deep link), so we can probably close this.

from react-navigation.

ericvicenti avatar ericvicenti commented on April 16, 2024

@markflorisson For now, you'd be best off using Linking.openURL in your app, but I might be in support of a OpenURI navigation action, if that is something you'd want to propose and push forward.

from react-navigation.

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.