From fa3bf03aa59bc736cd2982f8a0d2a8e702ac70da Mon Sep 17 00:00:00 2001 From: eshc123 Date: Wed, 20 Aug 2025 19:37:38 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=B1=EA=B7=B8=EB=9D=BC=EC=9A=B4=EB=93=9C?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=ED=91=B8=EC=8B=9C=20=EC=95=8C=EB=A6=BC=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20=EB=94=A5=EB=A7=81=ED=81=AC=20?= =?UTF-8?q?=EC=9D=B4=EB=8F=99=EC=9D=B4=20=EB=90=98=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8A=94=20=EC=9D=B4=EC=8A=88=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/push/TukFirebaseMessagingService.kt | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/core/push/src/main/java/com/plottwist/core/push/TukFirebaseMessagingService.kt b/core/push/src/main/java/com/plottwist/core/push/TukFirebaseMessagingService.kt index 000827c8..34971d95 100644 --- a/core/push/src/main/java/com/plottwist/core/push/TukFirebaseMessagingService.kt +++ b/core/push/src/main/java/com/plottwist/core/push/TukFirebaseMessagingService.kt @@ -2,6 +2,7 @@ package com.plottwist.core.push import android.app.PendingIntent import android.content.Intent +import com.google.firebase.messaging.Constants import com.google.firebase.messaging.FirebaseMessagingService import com.google.firebase.messaging.RemoteMessage import com.plottwist.core.notification.TukNotificationManager @@ -15,20 +16,16 @@ class TukFirebaseMessagingService : FirebaseMessagingService() { @Inject lateinit var tukNotificationManager: TukNotificationManager - override fun onNewToken(token: String) { super.onNewToken(token) } override fun onMessageReceived(message: RemoteMessage) { super.onMessageReceived(message) - - message.notification?.let { notificationMessage -> - val title = notificationMessage.title ?: TukNotificationManager.DEFAULT_TITLE - val description = notificationMessage.body ?: TukNotificationManager.DEFAULT_DESCRIPTION - val deeplink = message.data.get("deepLink") ?: "" - sendNotification(title, description, deeplink) - } + val title = message.data.get("title") ?: "" + val description = message.data.get("body") ?: "" + val deeplink = message.data.get("deepLink") ?: "" + sendNotification(title, description, deeplink) } private fun sendNotification(title: String, description: String, deeplink: String) { @@ -52,4 +49,17 @@ class TukFirebaseMessagingService : FirebaseMessagingService() { ) ) } + + + override fun handleIntent(intent: Intent?) { + val newIntent = intent?.apply { + val newExtras = extras?.apply { + remove(Constants.MessageNotificationKeys.ENABLE_NOTIFICATION) + remove("gcm.notification.e") + } + replaceExtras(newExtras) + } + super.handleIntent(newIntent) + + } }