diff --git a/api/src/main/java/com/tago/api/infra/fcm/FCMClient.java b/api/src/main/java/com/tago/api/infra/fcm/FCMClient.java index 036af234..43d49ae0 100644 --- a/api/src/main/java/com/tago/api/infra/fcm/FCMClient.java +++ b/api/src/main/java/com/tago/api/infra/fcm/FCMClient.java @@ -21,13 +21,15 @@ public void send(FCMSendDto dto) { String token = fcmTokenUtil.get(dto.getPhoneNumber()); Message message = Message.builder() + .putData("payload", dto.getPayload()) .putData("title", dto.getTitle()) .putData("content", dto.getContent()) .setToken(token) .build(); try { - FirebaseMessaging.getInstance().send(message); + String response = FirebaseMessaging.getInstance().send(message); + log.info("## SUCCESS SEND FCM ## " + response); } catch (FirebaseMessagingException e) { throw new FailedSendFCMException(e); } diff --git a/api/src/main/java/com/tago/api/infra/fcm/FCMSendDto.java b/api/src/main/java/com/tago/api/infra/fcm/FCMSendDto.java index 20c4d360..f10f1408 100644 --- a/api/src/main/java/com/tago/api/infra/fcm/FCMSendDto.java +++ b/api/src/main/java/com/tago/api/infra/fcm/FCMSendDto.java @@ -13,4 +13,5 @@ public class FCMSendDto { private String title; private String content; private String phoneNumber; + private String payload; } diff --git a/api/src/main/java/com/tago/api/infra/fcm/FCMService.java b/api/src/main/java/com/tago/api/infra/fcm/FCMService.java index f4dc8f4f..04222e0b 100644 --- a/api/src/main/java/com/tago/api/infra/fcm/FCMService.java +++ b/api/src/main/java/com/tago/api/infra/fcm/FCMService.java @@ -16,6 +16,7 @@ public class FCMService { public void sendByTripMemberEvent(TripMemberEvent event) { FCMType type = FCMType.from(event.getAction()); fcmClient.send(FCMSendDto.builder() + .payload(String.valueOf(event.getTripId())) .title(type.getTitle()) .content(type.getContent(event.getName())) .phoneNumber(event.getPhoneNumber()) diff --git a/api/src/main/java/com/tago/api/infra/fcm/FCMType.java b/api/src/main/java/com/tago/api/infra/fcm/FCMType.java index d509e5a9..87f7873a 100644 --- a/api/src/main/java/com/tago/api/infra/fcm/FCMType.java +++ b/api/src/main/java/com/tago/api/infra/fcm/FCMType.java @@ -6,7 +6,7 @@ import java.util.function.Function; @Getter public enum FCMType { - CREATE_TRIP_MEMBER("TAGO", (name) -> name + "님! 여행메이트가 한명 추가되었어요! 클릭해서 확인해보세요."), + CREATE_TRIP_MEMBER("TAGO", (name) -> name + "님! 여행인원이 한명 추가되었어요! 클릭해서 확인해보세요."), DELETE_TRIP_MEMBER("TAGO", (name) -> name + "님! 여행인원이 줄어들었어요. 클릭해서 확인해보세요."), COMPLETE_TRIP_MEMBER("TAGO", (name) -> name + "님! 여행인원이 모두 모집되었네요! 클릭해서 확인해보세요."), CREATE_DISPATCH("TAGO", (name) -> name + "님! 여행을 같이 할 기사님이 배정되었어요. 클릭해서 확인해보세요.")