Skip to content

Commit

Permalink
fix:config 주석해제 (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
sukmo88 authored Feb 10, 2025
2 parents 4edd42e + d11defc commit 676c87e
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions src/main/java/com/palbang/unsemawang/config/FirebaseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,23 @@
@Configuration
public class FirebaseConfig {
private FirebaseApp firebaseApp;
//
// @PostConstruct
// public FirebaseApp initializeFcm() throws IOException {
// // 프로젝트 내부에 있는 JSON 파일 로드
// log.info("FirebaseApp 실행되면 안되는디");
// ClassPathResource resource = new ClassPathResource("firebase/serviceAccountKey.json");
// InputStream serviceAccount = resource.getInputStream();
//
// FirebaseOptions options = FirebaseOptions.builder()
// .setCredentials(GoogleCredentials.fromStream(serviceAccount))
// .build();
//
// firebaseApp = FirebaseApp.initializeApp(options);
// log.info("FirebaseApp initialized");
// return firebaseApp;
// }
// @Bean
// public FirebaseMessaging initFirebaseMessaging() {
// return FirebaseMessaging.getInstance(firebaseApp);
// }

@PostConstruct
public FirebaseApp initializeFcm() throws IOException {
// 프로젝트 내부에 있는 JSON 파일 로드
ClassPathResource resource = new ClassPathResource("firebase/serviceAccountKey.json");
InputStream serviceAccount = resource.getInputStream();

FirebaseOptions options = FirebaseOptions.builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.build();

firebaseApp = FirebaseApp.initializeApp(options);
log.info("FirebaseApp initialized");
return firebaseApp;
}
@Bean
public FirebaseMessaging initFirebaseMessaging() {
return FirebaseMessaging.getInstance(firebaseApp);
}
}

0 comments on commit 676c87e

Please sign in to comment.