fix(deeplink): 예약 라이브 딥링크 라우팅을 메인으로 통일한다
This commit is contained in:
@@ -929,7 +929,7 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||||||
}
|
}
|
||||||
|
|
||||||
viewModel.getRoomDetail(roomId) {
|
viewModel.getRoomDetail(roomId) {
|
||||||
if (it.channelName != null) {
|
if (!it.channelName.isNullOrBlank()) {
|
||||||
if (it.manager.id == SharedPreferenceManager.userId) {
|
if (it.manager.id == SharedPreferenceManager.userId) {
|
||||||
handler.postDelayed({
|
handler.postDelayed({
|
||||||
viewModel.enterRoom(roomId, onEnterRoomSuccess)
|
viewModel.enterRoom(roomId, onEnterRoomSuccess)
|
||||||
|
|||||||
@@ -231,11 +231,7 @@ class DeepLinkActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
when {
|
when {
|
||||||
roomId != null && roomId > 0 -> {
|
roomId != null && roomId > 0 -> {
|
||||||
startActivity(
|
routeLiveInMain(roomId)
|
||||||
Intent(applicationContext, LiveRoomActivity::class.java).apply {
|
|
||||||
putExtra(Constants.EXTRA_ROOM_ID, roomId)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,11 +328,7 @@ class DeepLinkActivity : AppCompatActivity() {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
startActivity(
|
routeLiveInMain(deepLinkValueId)
|
||||||
Intent(applicationContext, LiveRoomActivity::class.java).apply {
|
|
||||||
putExtra(Constants.EXTRA_ROOM_ID, deepLinkValueId)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,4 +416,19 @@ class DeepLinkActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun routeLiveInMain(roomId: Long) {
|
||||||
|
val extras = Bundle().apply {
|
||||||
|
putString("room_id", roomId.toString())
|
||||||
|
putString("deep_link_value", "live")
|
||||||
|
putString("deep_link_sub5", roomId.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
startActivity(
|
||||||
|
Intent(applicationContext, MainActivity::class.java).apply {
|
||||||
|
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||||
|
putExtra(Constants.EXTRA_DATA, extras)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -317,11 +317,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
|
|||||||
val deepLinkUrl = bundle.getString("deep_link")
|
val deepLinkUrl = bundle.getString("deep_link")
|
||||||
if (!deepLinkUrl.isNullOrBlank()) {
|
if (!deepLinkUrl.isNullOrBlank()) {
|
||||||
val deepLinkBundle = buildBundleFromDeepLinkUrl(deepLinkUrl)
|
val deepLinkBundle = buildBundleFromDeepLinkUrl(deepLinkUrl)
|
||||||
if (deepLinkBundle != null) {
|
return executeBundleRoute(deepLinkBundle ?: bundle)
|
||||||
return executeBundleRoute(deepLinkBundle)
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return executeBundleRoute(bundle)
|
return executeBundleRoute(bundle)
|
||||||
@@ -340,18 +336,12 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
|
|||||||
?: bundle.getLong(Constants.EXTRA_AUDITION_ID).takeIf { it > 0 }
|
?: bundle.getLong(Constants.EXTRA_AUDITION_ID).takeIf { it > 0 }
|
||||||
val communityCreatorId = bundle.getString(Constants.EXTRA_COMMUNITY_CREATOR_ID)?.toLongOrNull()
|
val communityCreatorId = bundle.getString(Constants.EXTRA_COMMUNITY_CREATOR_ID)?.toLongOrNull()
|
||||||
?: bundle.getLong(Constants.EXTRA_COMMUNITY_CREATOR_ID).takeIf { it > 0 }
|
?: bundle.getLong(Constants.EXTRA_COMMUNITY_CREATOR_ID).takeIf { it > 0 }
|
||||||
val isLiveReservation = bundle.getBoolean(Constants.EXTRA_LIVE_RESERVATION_RESPONSE)
|
|
||||||
|
|
||||||
when {
|
when {
|
||||||
roomId != null && roomId > 0 -> {
|
roomId != null && roomId > 0 -> {
|
||||||
viewModel.clickTab(MainViewModel.CurrentTab.LIVE)
|
viewModel.clickTab(MainViewModel.CurrentTab.LIVE)
|
||||||
|
|
||||||
handler.postDelayed({
|
handler.postDelayed({
|
||||||
if (isLiveReservation) {
|
liveFragment.enterLiveRoom(roomId)
|
||||||
liveFragment.reservationRoom(roomId)
|
|
||||||
} else {
|
|
||||||
liveFragment.enterLiveRoom(roomId)
|
|
||||||
}
|
|
||||||
}, 500)
|
}, 500)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
40
docs/20260313_예약라이브알림딥링크분기수정.md
Normal file
40
docs/20260313_예약라이브알림딥링크분기수정.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# 20260313 예약라이브알림딥링크분기수정
|
||||||
|
|
||||||
|
## 작업 체크리스트
|
||||||
|
- [x] 알림 리스트/푸시/딥링크 라이브 라우팅 경로에서 예약 라이브 분기 위치를 정리한다.
|
||||||
|
- [x] 예약 라이브는 라이브 상세 페이지, 진행 중 라이브는 즉시 입장하도록 분기 로직을 반영한다.
|
||||||
|
- [x] 라이브룸 입장 상태에서 푸시/딥링크 실행 시 이동 확인 팝업 로직이 동일하게 동작하는지 점검하고 보정한다.
|
||||||
|
- [x] 관련 소스 LSP 진단, 단위 테스트, 빌드로 검증한다.
|
||||||
|
- [x] 검증 기록을 본 문서 하단에 누적한다.
|
||||||
|
|
||||||
|
## 검증 기록
|
||||||
|
- 무엇: 예약 라이브 딥링크가 `LiveRoomActivity`로 직행해 크래시를 유발하는 경로를 우회하고, `MainActivity -> LiveFragment.enterLiveRoom` 경로로 통일해 예약/진행중 상태를 내부 상세 조회로 판별하도록 수정했다.
|
||||||
|
왜: 예약 라이브는 라이브 상세가 열려야 하고, 진행중 라이브만 즉시 입장해야 하기 때문이다.
|
||||||
|
어떻게: `DeepLinkActivity`의 foreground 라우팅(`room_id`, `deep_link_value=live`)을 `MainActivity` 전달 방식으로 변경하고, `MainActivity.executeBundleRoute`에서 room 진입을 `enterLiveRoom` 단일 경로로 정리했다.
|
||||||
|
|
||||||
|
- 무엇: 라이브룸 화면에서 푸시/딥링크 실행 시 이동 확인 팝업 흐름 유지 여부를 점검했다.
|
||||||
|
왜: 라이브 입장 중에는 즉시 화면 전환 대신 사용자 확인이 필요하다.
|
||||||
|
어떻게: `LiveRoomActivity`의 `ACTION_LIVE_ROOM_DEEPLINK_CONFIRM` 수신 -> `showDeepLinkNavigationDialog` -> `MainActivity` 전달 흐름이 그대로 유지되는지 코드 경로를 확인했다.
|
||||||
|
|
||||||
|
- 무엇: 정적 진단/테스트/빌드를 수행했다.
|
||||||
|
왜: 변경으로 인한 회귀 여부를 확인하기 위해서다.
|
||||||
|
어떻게/결과:
|
||||||
|
- `lsp_diagnostics` (`DeepLinkActivity.kt`, `MainActivity.kt`): Kotlin LSP 서버 미설정으로 도구 실행 불가(환경 제약).
|
||||||
|
- `./gradlew :app:testDebugUnitTest`: 성공.
|
||||||
|
- `./gradlew :app:assembleDebug`: 성공.
|
||||||
|
|
||||||
|
- 무엇: Oracle 리뷰에서 발견된 라우팅 누락 가능성/오분기 가능성을 보완했다.
|
||||||
|
왜: `deep_link`가 있는 경우 원본 번들 fallback 누락과 `channelName` 빈 문자열 케이스가 실제 알림 라우팅 누락/오분기를 만들 수 있기 때문이다.
|
||||||
|
어떻게: `MainActivity.executeBundleDeeplink`에서 `deepLinkBundle ?: bundle` fallback으로 수정했고, `LiveFragment.enterLiveRoom` 분기 조건을 `channelName.isNullOrBlank()` 기준으로 정리했다.
|
||||||
|
|
||||||
|
- 무엇: 디바이스 수동 검증(ADB)으로 foreground 딥링크 경로를 확인했다.
|
||||||
|
왜: 변경된 foreground 경로가 `LiveRoomActivity` 직행이 아닌 `MainActivity` 경유로 동작하는지 확인하기 위해서다.
|
||||||
|
어떻게/결과:
|
||||||
|
- `./gradlew :app:installDebug`: 성공(실기기 설치 완료).
|
||||||
|
- `adb shell monkey -p kr.co.vividnext.sodalive.debug -c android.intent.category.LAUNCHER 1`: 앱 실행 성공.
|
||||||
|
- `adb shell am start -W -n kr.co.vividnext.sodalive.debug/kr.co.vividnext.sodalive.main.DeepLinkActivity -a android.intent.action.VIEW -d "voiceon://live/1"`: `Activity: ...MainActivity` 확인.
|
||||||
|
- `adb shell dumpsys activity activities | grep mResumedActivity`: `...MainActivity` 확인.
|
||||||
|
|
||||||
|
- 무엇: 라이브룸 입장 중 확인 팝업 로직은 코드 경로로 재검증했다.
|
||||||
|
왜: 로컬브로드캐스트 기반이라 ADB로 직접 이벤트 주입이 어렵기 때문이다.
|
||||||
|
어떻게/결과: `DeepLinkActivity`의 `ACTION_LIVE_ROOM_DEEPLINK_CONFIRM` 송신과 `LiveRoomActivity`의 다이얼로그 후 `MainActivity` 이동 경로가 변경 없이 유지됨을 확인했다.
|
||||||
Reference in New Issue
Block a user