diff --git a/backend/src/main/java/com/twtw/backend/domain/notification/dto/NotificationRequest.java b/backend/src/main/java/com/twtw/backend/domain/notification/dto/NotificationRequest.java index b56baea6..961edd93 100644 --- a/backend/src/main/java/com/twtw/backend/domain/notification/dto/NotificationRequest.java +++ b/backend/src/main/java/com/twtw/backend/domain/notification/dto/NotificationRequest.java @@ -1,8 +1,9 @@ package com.twtw.backend.domain.notification.dto; +import com.google.firebase.messaging.ApnsConfig; +import com.google.firebase.messaging.Aps; import com.google.firebase.messaging.Message; import com.google.firebase.messaging.Notification; - import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; @@ -14,12 +15,22 @@ @AllArgsConstructor public class NotificationRequest { + private static final ApnsConfig APNS_CONFIG = ApnsConfig.builder() + .putHeader("apns-priority", "10") + .setAps(Aps.builder() + .setBadge(1) + .build()).build(); + private String deviceToken; private String title; private String body; public Message toMessage() { - return Message.builder().setToken(deviceToken).setNotification(toNotification()).build(); + return Message.builder() + .setApnsConfig(APNS_CONFIG) + .setToken(deviceToken) + .setNotification(toNotification()) + .build(); } private Notification toNotification() {