Skip to content

Commit

Permalink
[COZY-235] fix : Message에 Notification 추가 (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
veronees authored Aug 30, 2024
1 parent 9b67081 commit a52d64d
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.firebase.messaging.FirebaseMessagingException;
import com.google.firebase.messaging.Message;
import com.google.firebase.messaging.Notification;
import java.util.HashMap;
import java.util.List;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -172,9 +173,15 @@ private List<Message> createMessage(Member member, NotificationType notification
messageMap.put("title", NOTIFICATION_TITLE);
messageMap.put("body", content);

Notification notification = Notification.builder()
.setTitle(NOTIFICATION_TITLE)
.setBody(content)
.build();

return Message.builder()
.putAllData(messageMap)
.setToken(token)
.setNotification(notification)
.build();
}).toList();

Expand All @@ -194,9 +201,15 @@ private List<Message> createMessage(Member contentMember, Member recipientMember
messageMap.put("title", NOTIFICATION_TITLE);
messageMap.put("body", content);

Notification notification = Notification.builder()
.setTitle(NOTIFICATION_TITLE)
.setBody(content)
.build();

return Message.builder()
.putAllData(messageMap)
.setToken(token)
.setNotification(notification)
.build();
}).toList();

Expand All @@ -216,9 +229,15 @@ private List<Message> createMessage(Member member, NotificationType notification
messageMap.put("title", NOTIFICATION_TITLE);
messageMap.put("body", content);

Notification notification = Notification.builder()
.setTitle(NOTIFICATION_TITLE)
.setBody(content)
.build();

return Message.builder()
.putAllData(messageMap)
.setToken(token)
.setNotification(notification)
.build();
}).toList();

Expand All @@ -238,9 +257,15 @@ private List<Message> createMessage(Member member, NotificationType notification
messageMap.put("title", NOTIFICATION_TITLE);
messageMap.put("body", content);

Notification notification = Notification.builder()
.setTitle(NOTIFICATION_TITLE)
.setBody(content)
.build();

return Message.builder()
.putAllData(messageMap)
.setToken(token)
.setNotification(notification)
.build();
}).toList();

Expand Down Expand Up @@ -324,9 +349,15 @@ private List<Message> createMessage(Member contentMember, Room room, Member reci
messageMap.put("title", NOTIFICATION_TITLE);
messageMap.put("body", content);

Notification notification = Notification.builder()
.setTitle(NOTIFICATION_TITLE)
.setBody(content)
.build();

return Message.builder()
.putAllData(messageMap)
.setToken(token)
.setNotification(notification)
.build();
}).toList();

Expand Down

0 comments on commit a52d64d

Please sign in to comment.