diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmService.kt index 0f27f69..9bf8260 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmService.kt @@ -3,11 +3,14 @@ package kr.co.vividnext.sodalive.fcm import com.google.firebase.messaging.FirebaseMessaging import com.google.firebase.messaging.MulticastMessage import com.google.firebase.messaging.Notification +import org.slf4j.LoggerFactory import org.springframework.scheduling.annotation.Async import org.springframework.stereotype.Service @Service class FcmService { + private val logger = LoggerFactory.getLogger(this::class.java) + @Async fun send( tokens: List, @@ -47,6 +50,8 @@ class FcmService { multicastMessage.putData("content_id", contentId.toString()) } - FirebaseMessaging.getInstance().sendEachForMulticast(multicastMessage.build()) + val response = FirebaseMessaging.getInstance().sendEachForMulticast(multicastMessage.build()) + logger.info("보내기 성공: ${response.successCount}") + logger.info("보내기 실패: ${response.failureCount}") } }