Skip to content

Deprecation warning

This page in the documentation is about Appyx 1.x.

Appyx is now in its 2.x iteration.

To access the 2.x-related pages please check the sidebar or go to:

Documentation root


Deep linking

Building on top of explicit navigation, implementing deep links is straightforward:

class ExplicitNavigationExampleActivity : NodeActivity(), Navigator {

    lateinit var rootNode: RootNode

    fun handleDeepLink(intent: Intent) {
        if (intent.action == Intent.ACTION_VIEW) {
            when {
                (it.data?.host == "onboarding") -> navigateToOnBoarding()
                else -> Unit
            }
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            NodeHost(integrationPoint = appyxIntegrationPoint) {
                RootNode(
                    buildContext = it,
                    plugins = listOf(object : NodeReadyObserver<RootNode> {
                        override fun init(node: RootNode) {
                            rootNode = node
                            handleDeepLink(intent = intent)
                        }
                    })
                )
            }
        }
    }

    private fun navigateToOnBoarding() {
        // implement explicit navigation
    }
}

Check ExplicitNavigationExampleActivity in the samples to inspect the full code.