Skip to content

Commit

Permalink
feat: fcm deprecated api 대응 (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
hocaron authored Sep 19, 2024
2 parents 0016dfd + 923b080 commit 81d46c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void handleSendPushNotiEvent(PushNotiSendVo event) {
pushNotiService.sendPushNotification(event);
}catch (Exception ignored){
log.error("[SEND_PUSH_FAIL] failed to send push memberIds {} , title {} , body {}",
extractMemberIds(event), event.getTitle(), event.getBody());
extractMemberIds(event), event.getTitle(), event.getBody(), ignored);
}
}

Expand Down
2 changes: 1 addition & 1 deletion mashup-domain/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies{
implementation "com.github.ulisesbocchio:jasypt-spring-boot-starter:$jasyptVersion"
implementation 'com.querydsl:querydsl-jpa'
implementation 'com.querydsl:querydsl-apt'
implementation 'com.google.firebase:firebase-admin:7.1.0'
implementation 'com.google.firebase:firebase-admin:9.3.0'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa"
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'
annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package kr.mashup.branding.infrastructure.pushnoti;

import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

import org.springframework.stereotype.Service;

import com.google.firebase.FirebaseApp;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.firebase.messaging.FirebaseMessagingException;
import com.google.firebase.messaging.MulticastMessage;
import com.google.firebase.messaging.Notification;

import kr.mashup.branding.domain.member.Member;
import kr.mashup.branding.domain.pushnoti.exception.PushNotiException;
import kr.mashup.branding.domain.pushnoti.vo.PushNotiSendVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

@Slf4j
@Service
Expand All @@ -34,7 +32,7 @@ public void sendPushNotification(PushNotiSendVo pushNotiSendVo) {
.addAllTokens(getAgreedFcmTokens(pushNotiSendVo.getMembers()))
.build();
try {
FirebaseMessaging.getInstance(firebaseApp).sendMulticast(multicastMessage);
FirebaseMessaging.getInstance(firebaseApp).sendEachForMulticast(multicastMessage);
} catch (FirebaseMessagingException e) {
throw new PushNotiException();
}
Expand Down

0 comments on commit 81d46c7

Please sign in to comment.