Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package konkuk.thip.message.application.service;

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 konkuk.thip.message.application.port.in.FeedNotificationDispatchUseCase;
Expand Down Expand Up @@ -74,6 +76,7 @@ private void push(Long userId, Notification n, Long notificationId) {
.putData("category", NotificationCategory.FEED.getDisplay())
.putData("action", "OPEN_NOTIFICATION") // FE는 이 액션으로 알림 상세/라우팅을 BE api 요청으로 처리
.putData("notificationId", String.valueOf(notificationId))
.setApnsConfig(buildApnsConfig())
.build();

msgs.add(m);
Expand All @@ -87,4 +90,10 @@ private void push(Long userId, Notification n, Long notificationId) {
private Notification buildFcmNotification(final String title, final String body) {
return Notification.builder().setTitle(title).setBody(body).build();
}

private ApnsConfig buildApnsConfig() {
return ApnsConfig.builder()
.setAps(Aps.builder().setSound("default").build())
.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package konkuk.thip.message.application.service;

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 konkuk.thip.message.application.port.in.RoomNotificationDispatchUseCase;
Expand Down Expand Up @@ -86,6 +88,7 @@ private void push(Long userId, String title, String content, Long notificationId
.putData("category", NotificationCategory.ROOM.getDisplay())
.putData("action", "OPEN_NOTIFICATION") // FE는 이 액션으로 알림 상세/라우팅을 BE api 요청으로 처리
.putData("notificationId", String.valueOf(notificationId))
.setApnsConfig(buildApnsConfig())
.build();
msgs.add(m); tk.add(t.getFcmToken()); dev.add(t.getDeviceId());
}
Expand All @@ -99,4 +102,10 @@ private Notification buildNotification(final String title, final String body) {
.setBody(body)
.build();
}

private ApnsConfig buildApnsConfig() {
return ApnsConfig.builder()
.setAps(Aps.builder().setSound("default").build())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public record FcmTokenRegisterRequest(
String fcmToken,

@NotBlank(message = "플랫폼 타입은 필수입니다.")
@Schema(description = "플랫폼 타입 (ANDROID 또는 WEB)", example = "ANDROID")
@Schema(description = "플랫폼 타입 (ANDROID, WEB 또는 IOS)", example = "ANDROID")
String platformType
) {
public FcmTokenRegisterCommand toCommand(Long userId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
@RequiredArgsConstructor
public enum PlatformType {
ANDROID("ANDROID"),
WEB("WEB");
WEB("WEB"),
IOS("IOS");

private final String value;

Expand Down
Loading