Skip to content

Commit

Permalink
fix: FCM 초기화 문제 수정
Browse files Browse the repository at this point in the history
이후 배포 테스트
  • Loading branch information
kanguk01 committed Nov 1, 2024
1 parent a3688d7 commit 1a216bc
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/main/java/com/splanet/splanet/core/fcm/FCMInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ public class FCMInitializer {
@PostConstruct
public void initialize() {
try {
GoogleCredentials googleCredentials = GoogleCredentials
.fromStream(new ClassPathResource(FIREBASE_CONFIG_PATH).getInputStream());
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(googleCredentials)
.build();
FirebaseApp.initializeApp(options);
if (FirebaseApp.getApps().isEmpty()) {
GoogleCredentials googleCredentials = GoogleCredentials
.fromStream(new ClassPathResource(FIREBASE_CONFIG_PATH).getInputStream());
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(googleCredentials)
.build();
FirebaseApp.initializeApp(options);
log.info("FirebaseApp 초기화 완료");
} else {
log.info("FirebaseApp이 이미 초기화되었습니다.");
}
} catch (IOException e) {
log.info("FCM initialization error occurred.");
log.error("FCM error message : " + e.getMessage());
log.error("FCM 초기화 오류 발생: " + e.getMessage());
}
}
}
}

0 comments on commit 1a216bc

Please sign in to comment.