fix: fcm 데이터 수신 수정

- data-only, notification+data 방식 모두 동일하게 딥링크가 적용되도록 수정
This commit is contained in:
klaus 2025-05-09 11:55:56 +09:00
parent 60190e099a
commit 1720173a16
1 changed files with 13 additions and 7 deletions

View File

@ -45,6 +45,7 @@ import kr.co.vividnext.sodalive.databinding.ItemMainTabBinding
import kr.co.vividnext.sodalive.explorer.profile.UserProfileActivity
import kr.co.vividnext.sodalive.extensions.dpToPx
import kr.co.vividnext.sodalive.live.LiveFragment
import kr.co.vividnext.sodalive.message.MessageActivity
import kr.co.vividnext.sodalive.mypage.MyPageFragment
import kr.co.vividnext.sodalive.settings.event.EventDetailActivity
import kr.co.vividnext.sodalive.settings.notification.NotificationSettingsDialog
@ -230,7 +231,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
getMemberInfo()
val intentFilter = IntentFilter(Constants.ACTION_MAIN_AUDIO_CONTENT_RECEIVER)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
registerReceiver(audioContentReceiver, intentFilter, Context.RECEIVER_NOT_EXPORTED)
registerReceiver(audioContentReceiver, intentFilter, RECEIVER_NOT_EXPORTED)
} else {
registerReceiver(audioContentReceiver, intentFilter)
}
@ -273,11 +274,16 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
bundle != null
) {
try {
val roomId = bundle.getLong(Constants.EXTRA_ROOM_ID)
val channelId = bundle.getLong(Constants.EXTRA_USER_ID)
val messageId = bundle.getLong(Constants.EXTRA_MESSAGE_ID)
val auditionId = bundle.getLong(Constants.EXTRA_AUDITION_ID)
val contentId = bundle.getLong(Constants.EXTRA_AUDIO_CONTENT_ID)
val roomId = bundle.getString("room_id")?.toLong()
?: bundle.getLong(Constants.EXTRA_ROOM_ID)
val channelId = bundle.getString("channel_id")?.toLong()
?: bundle.getLong(Constants.EXTRA_USER_ID)
val messageId = bundle.getString("message_id")?.toLong()
?: bundle.getLong(Constants.EXTRA_MESSAGE_ID)
val auditionId = bundle.getString("audition_id")?.toLong()
?: bundle.getLong(Constants.EXTRA_AUDITION_ID)
val contentId = bundle.getString("content_id")?.toLong()
?: bundle.getLong(Constants.EXTRA_AUDIO_CONTENT_ID)
val isLiveReservation = bundle.getBoolean(Constants.EXTRA_LIVE_RESERVATION_RESPONSE)
if (roomId > 0) {
@ -302,7 +308,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
nextIntent.putExtra(Constants.EXTRA_AUDIO_CONTENT_ID, contentId)
startActivity(nextIntent)
} else if (messageId > 0) {
// 메시지 페이지로 이동
startActivity(Intent(applicationContext, MessageActivity::class.java))
} else if (auditionId > 0) {
viewModel.clickTab(MainViewModel.CurrentTab.AUDITION)
}