Skip to content

Commit 536de79

Browse files
authored
Fix: [FCM] project id 추가 (#80)
1 parent 2c73ad3 commit 536de79

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

runtracker/src/main/java/com/runtracker/global/fcm/FcmClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public Boolean send(String title, String body, String token) {
2828

2929
return response != null && !response.isEmpty();
3030
} catch (Exception e) {
31-
log.warn("Failed to send FCM message. token: {}", token, e);
31+
log.error("FCM 메시지 발송 실패 Error: {}", e.getMessage());
3232
return false;
3333
}
3434
}

runtracker/src/main/java/com/runtracker/global/fcm/FirebaseConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@
88
import org.springframework.context.annotation.Bean;
99
import org.springframework.context.annotation.Configuration;
1010
import org.springframework.core.io.ClassPathResource;
11+
import lombok.extern.slf4j.Slf4j;
1112

1213
import javax.annotation.PostConstruct;
1314
import java.io.IOException;
1415

16+
@Slf4j
1517
@Configuration
1618
public class FirebaseConfig {
1719

1820
@Value("${firebase.service-account-key:#{null}}")
1921
private String serviceAccountKeyPath;
2022

23+
@Value("${firebase.project_id:#{null}}")
24+
private String firebaseProjectId;
25+
2126
@PostConstruct
2227
public void initialize() {
2328
try {
@@ -38,6 +43,7 @@ public void initialize() {
3843

3944
FirebaseOptions options = FirebaseOptions.builder()
4045
.setCredentials(googleCredentials)
46+
.setProjectId(firebaseProjectId)
4147
.build();
4248

4349
if (FirebaseApp.getApps().isEmpty()) {

0 commit comments

Comments
 (0)