Skip to content

Commit

Permalink
fix: fcm 토큰이 빈 값이라면 푸시 알림을 보내지 않도록 설정 (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdomo authored Feb 6, 2024
1 parent 232871f commit 434f2a4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public List<MemberFollowedResponse> followedUserFindAll() {
return followService.findAllFollowedMember();
}

// 팔로잉, 팔로워 리스트 응답
@GetMapping("/{targetId}/list")
@Operation(summary = "팔로잉, 팔로워 유저 리스트를 반환합니다", description = "팔로잉, 팔로워 유저들을 반환합니다.")
public FollowListResponse followList(@PathVariable Long targetId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private FcmInfo(String fcmToken, Boolean appAlarm) {
}

public static FcmInfo createFcmInfo() {
return FcmInfo.builder().fcmToken("").appAlarm(true).build();
return FcmInfo.builder().appAlarm(true).build();
}

public static FcmInfo toggleAlarm(FcmInfo fcmState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class Member extends BaseTimeEntity {

@Embedded private OauthInfo oauthInfo;

@Embedded private FcmInfo fcmInfo = FcmInfo.createFcmInfo();
@Embedded private FcmInfo fcmInfo;

@Enumerated(EnumType.STRING)
private MemberStatus status;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/depromeet/global/config/fcm/FcmService.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public ApiFuture<BatchResponse> sendGroupMessageAsync(
}

public ApiFuture<String> sendMessageSync(String token, String title, String content) {
if (token == null || token.isEmpty()) {
return null;
}
Message message =
Message.builder()
.setToken(token)
Expand Down

0 comments on commit 434f2a4

Please sign in to comment.