Skip to content

Commit

Permalink
[FEAT] FcmService Logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjoo-lab committed Dec 23, 2023
1 parent ef7bddc commit 9770634
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@

@Configuration
public class FcmConfig {
private final ClassPathResource firebaseResource = new ClassPathResource(
private static final ClassPathResource FIREBASE_RESOURCE = new ClassPathResource(
"backend/src/main/resources/firebase/twtw_firebase_key.json"
);

@Bean
FirebaseApp firebaseApp() throws IOException {
public FirebaseApp firebaseApp() throws IOException {
FirebaseOptions options = FirebaseOptions.builder()
.setCredentials(GoogleCredentials.fromStream(firebaseResource.getInputStream()))
.setCredentials(GoogleCredentials.fromStream(FIREBASE_RESOURCE.getInputStream()))
.build();

return FirebaseApp.initializeApp(options);
}

@Bean
FirebaseMessaging firebaseMessaging() throws IOException {
public FirebaseMessaging firebaseMessaging() throws IOException {
return FirebaseMessaging.getInstance(firebaseApp());
}
}

0 comments on commit 9770634

Please sign in to comment.