Updated on 2026-08-14
This commit is contained in:
parent
8beb80f5a7
commit
43d6e92a89
26 changed files with 639 additions and 8 deletions
|
|
@ -13,6 +13,7 @@ dependencies {
|
|||
/* Core */
|
||||
implementation(projects.core.decompose)
|
||||
implementation(projects.core.configToggles)
|
||||
implementation(projects.core.navigation)
|
||||
|
||||
/* Domain */
|
||||
implementation(projects.domain.qrScanning.models)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.tangem.common.routing
|
||||
|
||||
import android.net.Uri
|
||||
import timber.log.Timber
|
||||
|
||||
/**
|
||||
* Routes in-app content links (deep links and external URLs)
|
||||
* - `tangem://` scheme → parsed to AppRoute and pushed via AppRouter
|
||||
* - `https://` / `http://` → opened in external browser via UrlOpener
|
||||
* - Unknown scheme → logged and ignored
|
||||
*/
|
||||
class LinkHandler(
|
||||
private val appRouter: AppRouter,
|
||||
) {
|
||||
|
||||
fun navigate(link: String) {
|
||||
val uri = Uri.parse(link)
|
||||
handleTangemDeepLink(uri)
|
||||
}
|
||||
|
||||
private fun handleTangemDeepLink(uri: Uri) {
|
||||
val route = parseDeepLinkToRoute(uri)
|
||||
if (route != null) {
|
||||
appRouter.push(route)
|
||||
} else {
|
||||
Timber.w("ContentLinkHandler: unrecognized tangem deep link: %s", uri)
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("UnusedParameter", "FunctionOnlyReturningConstant")
|
||||
private fun parseDeepLinkToRoute(uri: Uri): AppRoute? {
|
||||
// TODO [REDACTED_TASK_KEY] refactor deepling routing
|
||||
return null
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue