feat(pushnotification): 홈 알림 리스트 화면과 딥링크 라우팅을 추가한다
This commit is contained in:
@@ -5,6 +5,7 @@ import android.app.NotificationManager
|
||||
import android.app.PendingIntent
|
||||
import android.content.Intent
|
||||
import android.media.RingtoneManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
@@ -66,6 +67,14 @@ class SodaFirebaseMessagingService : FirebaseMessagingService() {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
|
||||
val deepLinkUrl = messageData["deepLink"] ?: messageData["deep_link"]
|
||||
if (!deepLinkUrl.isNullOrBlank()) {
|
||||
runCatching {
|
||||
intent.action = Intent.ACTION_VIEW
|
||||
intent.data = Uri.parse(deepLinkUrl)
|
||||
}
|
||||
}
|
||||
|
||||
val deepLinkExtras = android.os.Bundle().apply {
|
||||
messageData["room_id"]?.let { putString("room_id", it) }
|
||||
messageData["message_id"]?.let { putString("message_id", it) }
|
||||
|
||||
Reference in New Issue
Block a user