test #9

Merged
klaus merged 6 commits from test into main 2023-08-20 19:22:23 +00:00
1 changed files with 6 additions and 1 deletions
Showing only changes of commit 629528b6cf - Show all commits

View File

@ -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<String>,
@ -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}")
}
}