Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deep linking #5

Open
nhaarman opened this issue Aug 16, 2018 · 2 comments
Open

Deep linking #5

nhaarman opened this issue Aug 16, 2018 · 2 comments
Labels
type:documentation Documentation is needed

Comments

@nhaarman
Copy link
Owner

Related to #4

It should be possible to deep link into an application, for example to navigate directly to a product detail page.

@nhaarman nhaarman added the type:needs-design Uncharted territory label Sep 12, 2018
@nhaarman
Copy link
Owner Author

This can be done by either

  • Having a different Activity with its own Navigator handle the Intent in a completely separate task;
  • Wrapping the 'main' Navigator in another Navigator (like CompositeStackNavigator) and push the new Navigator on it.

@nhaarman nhaarman added type:documentation Documentation is needed and removed type:needs-design Uncharted territory labels Sep 25, 2018
@VincentJian
Copy link

VincentJian commented May 27, 2020

This can be done by either

* Having a different Activity with its own Navigator handle the Intent in a completely separate task;

* Wrapping the 'main' Navigator in another Navigator (like `CompositeStackNavigator`) and push the new Navigator on it.

Is the document ready (even draft is fine)?

I am writing integration test (using espresso) to test navigation between scenes. For example, create deep link: (skip splash scene ->) login scene -> register scene, and start with register scene first, then test press back will navigate back to login scene.

Here is how I try to create deep link by providing another NavigatorProvider with pre-defined NavigatorState.

object : AbstractNavigatorProvider<MainNavigator>() {
  override fun createNavigator(savedState: NavigatorState?): MainNavigator {
    return MainNavigator(navigatorState { state ->
      state["navigator:class"] = AuthNavigator::class.java.name
      state["navigator:state"] = navigatorState { navState ->
        navState["size"] = 2
        navState["0_class"] = LoginScene::class.java.name
        navState["1_class"] = RegisterScene::class.java.name
      }
    })
  }
}

And I know it looks like a hack, but I don't know how to create another navigator to wrap the 'main' Navigator that I want to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:documentation Documentation is needed
Projects
None yet
Development

No branches or pull requests

2 participants