acorn
acorn copied to clipboard
Deep linking
Related to #4
It should be possible to deep link into an application, for example to navigate directly to a product detail page.
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.
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.