푸시 발송 이벤트 - container가 필요한 부분에 container 추가
This commit is contained in:
parent
2548c92aa1
commit
ccb32a73dd
|
@ -272,7 +272,20 @@ class AudioContentService(
|
||||||
message = "콘텐츠를 업로드 하였습니다. - ${audioContent.title}",
|
message = "콘텐츠를 업로드 하였습니다. - ${audioContent.title}",
|
||||||
isAuth = audioContent.isAdult,
|
isAuth = audioContent.isAdult,
|
||||||
contentId = contentId,
|
contentId = contentId,
|
||||||
creatorId = audioContent.member!!.id
|
creatorId = audioContent.member!!.id,
|
||||||
|
container = "ios"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
applicationEventPublisher.publishEvent(
|
||||||
|
FcmEvent(
|
||||||
|
type = FcmEventType.UPLOAD_CONTENT,
|
||||||
|
title = audioContent.member!!.nickname,
|
||||||
|
message = "콘텐츠를 업로드 하였습니다. - ${audioContent.title}",
|
||||||
|
isAuth = audioContent.isAdult,
|
||||||
|
contentId = contentId,
|
||||||
|
creatorId = audioContent.member!!.id,
|
||||||
|
container = "aos"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,14 +35,13 @@ class FcmSendListener(
|
||||||
fun send(fcmEvent: FcmEvent) {
|
fun send(fcmEvent: FcmEvent) {
|
||||||
when (fcmEvent.type) {
|
when (fcmEvent.type) {
|
||||||
FcmEventType.ALL -> {
|
FcmEventType.ALL -> {
|
||||||
|
logger.info("ALL")
|
||||||
if (fcmEvent.container.isNotBlank()) {
|
if (fcmEvent.container.isNotBlank()) {
|
||||||
val pushTokens = memberRepository.getAllRecipientPushTokens(
|
val pushTokens = memberRepository.getAllRecipientPushTokens(
|
||||||
fcmEvent.isAuth,
|
fcmEvent.isAuth,
|
||||||
fcmEvent.container
|
fcmEvent.container
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info("tokens::: $pushTokens")
|
|
||||||
|
|
||||||
for (tokens in pushTokens) {
|
for (tokens in pushTokens) {
|
||||||
pushService.send(
|
pushService.send(
|
||||||
tokens = tokens,
|
tokens = tokens,
|
||||||
|
@ -55,14 +54,13 @@ class FcmSendListener(
|
||||||
}
|
}
|
||||||
|
|
||||||
FcmEventType.INDIVIDUAL -> {
|
FcmEventType.INDIVIDUAL -> {
|
||||||
|
logger.info("INDIVIDUAL")
|
||||||
if (fcmEvent.recipients.isNotEmpty()) {
|
if (fcmEvent.recipients.isNotEmpty()) {
|
||||||
val pushTokens = memberRepository.getIndividualRecipientPushTokens(
|
val pushTokens = memberRepository.getIndividualRecipientPushTokens(
|
||||||
recipients = fcmEvent.recipients,
|
recipients = fcmEvent.recipients,
|
||||||
isAuth = fcmEvent.isAuth
|
isAuth = fcmEvent.isAuth
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info("tokens::: $pushTokens")
|
|
||||||
|
|
||||||
val iosPushTokens = pushTokens["ios"]
|
val iosPushTokens = pushTokens["ios"]
|
||||||
val aosPushToken = pushTokens["aos"]
|
val aosPushToken = pushTokens["aos"]
|
||||||
|
|
||||||
|
@ -91,6 +89,8 @@ class FcmSendListener(
|
||||||
}
|
}
|
||||||
|
|
||||||
FcmEventType.CREATE_LIVE, FcmEventType.START_LIVE -> {
|
FcmEventType.CREATE_LIVE, FcmEventType.START_LIVE -> {
|
||||||
|
logger.info("CREATE_LIVE")
|
||||||
|
logger.info("START_LIVE")
|
||||||
if (fcmEvent.container.isNotBlank()) {
|
if (fcmEvent.container.isNotBlank()) {
|
||||||
val pushTokens = memberRepository.getCreateLiveRoomNotificationRecipientPushTokens(
|
val pushTokens = memberRepository.getCreateLiveRoomNotificationRecipientPushTokens(
|
||||||
creatorId = fcmEvent.creatorId!!,
|
creatorId = fcmEvent.creatorId!!,
|
||||||
|
@ -98,8 +98,6 @@ class FcmSendListener(
|
||||||
container = fcmEvent.container
|
container = fcmEvent.container
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info("tokens::: $pushTokens")
|
|
||||||
|
|
||||||
for (tokens in pushTokens) {
|
for (tokens in pushTokens) {
|
||||||
pushService.send(
|
pushService.send(
|
||||||
tokens = tokens,
|
tokens = tokens,
|
||||||
|
@ -113,6 +111,7 @@ class FcmSendListener(
|
||||||
}
|
}
|
||||||
|
|
||||||
FcmEventType.UPLOAD_CONTENT -> {
|
FcmEventType.UPLOAD_CONTENT -> {
|
||||||
|
logger.info("UPLOAD_CONTENT")
|
||||||
if (fcmEvent.container.isNotBlank()) {
|
if (fcmEvent.container.isNotBlank()) {
|
||||||
val pushTokens = memberRepository.getUploadContentNotificationRecipientPushTokens(
|
val pushTokens = memberRepository.getUploadContentNotificationRecipientPushTokens(
|
||||||
creatorId = fcmEvent.creatorId!!,
|
creatorId = fcmEvent.creatorId!!,
|
||||||
|
@ -120,8 +119,6 @@ class FcmSendListener(
|
||||||
container = fcmEvent.container
|
container = fcmEvent.container
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info("tokens::: $pushTokens")
|
|
||||||
|
|
||||||
for (tokens in pushTokens) {
|
for (tokens in pushTokens) {
|
||||||
pushService.send(
|
pushService.send(
|
||||||
tokens = tokens,
|
tokens = tokens,
|
||||||
|
@ -135,10 +132,9 @@ class FcmSendListener(
|
||||||
}
|
}
|
||||||
|
|
||||||
FcmEventType.SEND_MESSAGE -> {
|
FcmEventType.SEND_MESSAGE -> {
|
||||||
|
logger.info("SEND_MESSAGE")
|
||||||
val response = memberRepository.getMessageRecipientPushToken(messageId = fcmEvent.messageId!!)
|
val response = memberRepository.getMessageRecipientPushToken(messageId = fcmEvent.messageId!!)
|
||||||
|
|
||||||
logger.info("tokens::: ${response.pushToken}")
|
|
||||||
|
|
||||||
pushService.send(
|
pushService.send(
|
||||||
tokens = listOf(response.pushToken),
|
tokens = listOf(response.pushToken),
|
||||||
title = fcmEvent.title,
|
title = fcmEvent.title,
|
||||||
|
|
|
@ -254,7 +254,24 @@ class LiveRoomService(
|
||||||
},
|
},
|
||||||
isAuth = createdRoom.isAdult,
|
isAuth = createdRoom.isAdult,
|
||||||
roomId = createdRoom.id,
|
roomId = createdRoom.id,
|
||||||
creatorId = createdRoom.member!!.id
|
creatorId = createdRoom.member!!.id,
|
||||||
|
container = "ios"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
applicationEventPublisher.publishEvent(
|
||||||
|
FcmEvent(
|
||||||
|
type = FcmEventType.CREATE_LIVE,
|
||||||
|
title = createdRoom.member!!.nickname,
|
||||||
|
message = if (createdRoom.channelName != null) {
|
||||||
|
"라이브를 시작했습니다. - ${createdRoom.title}"
|
||||||
|
} else {
|
||||||
|
"라이브를 개설했습니다. - ${createdRoom.title}"
|
||||||
|
},
|
||||||
|
isAuth = createdRoom.isAdult,
|
||||||
|
roomId = createdRoom.id,
|
||||||
|
creatorId = createdRoom.member!!.id,
|
||||||
|
container = "aos"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -386,7 +403,20 @@ class LiveRoomService(
|
||||||
message = "라이브를 시작했습니다 - ${room.title}",
|
message = "라이브를 시작했습니다 - ${room.title}",
|
||||||
isAuth = room.isAdult,
|
isAuth = room.isAdult,
|
||||||
roomId = room.id,
|
roomId = room.id,
|
||||||
creatorId = room.member!!.id
|
creatorId = room.member!!.id,
|
||||||
|
container = "ios"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
applicationEventPublisher.publishEvent(
|
||||||
|
FcmEvent(
|
||||||
|
type = FcmEventType.START_LIVE,
|
||||||
|
title = room.member!!.nickname,
|
||||||
|
message = "라이브를 시작했습니다 - ${room.title}",
|
||||||
|
isAuth = room.isAdult,
|
||||||
|
roomId = room.id,
|
||||||
|
creatorId = room.member!!.id,
|
||||||
|
container = "aos"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue