Skip to content

Commit 85efa4e

Browse files
committed
FEAT: 딥링크 처리
1 parent 23bf67f commit 85efa4e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

feature/main/src/main/java/com/plottwist/feature/main/MainActivity.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package com.plottwist.feature.main
22

3+
import android.content.Intent
34
import android.os.Bundle
45
import androidx.activity.ComponentActivity
56
import androidx.activity.compose.setContent
67
import androidx.activity.enableEdgeToEdge
8+
import androidx.core.net.toUri
79
import com.plottwist.feature.main.ui.theme.TukTheme
810
import dagger.hilt.android.AndroidEntryPoint
911

@@ -13,6 +15,7 @@ class MainActivity : ComponentActivity() {
1315
super.onCreate(savedInstanceState)
1416
enableEdgeToEdge()
1517

18+
handleDeepLink(intent)
1619
setComposeContent()
1720
}
1821

@@ -24,6 +27,16 @@ class MainActivity : ComponentActivity() {
2427
}
2528
}
2629

30+
private fun handleDeepLink(
31+
intent: Intent,
32+
) {
33+
val deepLink = intent.extras?.getString("deepLink") ?: return
34+
35+
startActivity(Intent(Intent.ACTION_VIEW).apply {
36+
data = deepLink.toUri()
37+
})
38+
}
39+
2740
companion object {
2841
const val NOTIFICATION_REQUEST_CODE = 0
2942
}

0 commit comments

Comments
 (0)