Created
November 29, 2020 11:39
-
-
Save mayuce/cb2133d9f520c3ad113960bf37b54bae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.some.thing.feature_main | |
import android.content.Context | |
import android.net.Uri | |
import com.some.thing.common.routerdata.MainRouterData | |
import com.some.thing.routing.Routable | |
import com.some.thing.feature_main.presentation.MainActivity | |
class MainRouter { | |
companion object : Routable<MainActivity, MainRouterData> { | |
override val route: Class<MainActivity> | |
get() = MainActivity::class.java | |
override val deepLinkCode: Int | |
get() = MainRouterData.ROUTER_ID | |
override val routerDataClass: Class<MainRouterData> | |
get() = MainRouterData::class.java | |
/** | |
I just overridded it to be an example, you don't have to overridde it | |
We are providing a deep link implementation with this. | |
@example link: https://app.something.com/route?KEY_USER_ID=10 | |
*/ | |
override fun startDeepLink(context: Context?, data: Uri?) { | |
startActivity(context, MainRouterData(data?.getQueryParameter('KEY_USER_ID'))) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment