Skip to content

Commit

Permalink
fix: 로그 추가 및 문구 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jihoon-jang committed Oct 21, 2023
1 parent 6ac8c79 commit 58504fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public String getParameterWithoutBold(final String parameter) {
if (this == STAMP_REQUEST || this == REWARD_REQUEST || this == STAMP_BOARD_COMPLETE || this == REWARDED
|| this == REWARD_REQUEST_AGAIN || this == REWARD_FAIL || this == CREATED_STAMP_BOARD
|| this == ISSUED_COUPON || this == REWARDED_REQUEST) {
return String.format(this.message, "<b>'" + parameter + "'</b>");
return String.format(this.message, parameter);
}
return String.format(this.message, parameter);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
import com.polzzak.domain.user.entity.Member;

import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;

@Service
@Log4j2
@RequiredArgsConstructor
public class FirebaseCloudMessageService {

Expand Down Expand Up @@ -51,15 +53,16 @@ public void sendPushNotification(Member member, String title, String body, Strin
.putData("link", link)
.build();
BatchResponse response = null;
log.info("push. token: {}, title: {}, body: {}, link: {}", registrationTokens, title, body, link);
try {
response = FirebaseMessaging.getInstance().sendEachForMulticast(message);
} catch (FirebaseMessagingException e) {
log.warn("fail push.");
e.printStackTrace();
}
// See the BatchResponse reference documentation
// for the contents of response.
System.out.println(response.getSuccessCount() + " messages were sent successfully");
System.out.println(response);
log.info(response.getSuccessCount() + " messages were sent successfully");

} catch (Exception e) {

Expand Down

0 comments on commit 58504fd

Please sign in to comment.