We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ebfa5a commit 723e619Copy full SHA for 723e619
backend/ongi/src/main/java/ongi/firebase/FirebaseConfig.java
@@ -1,14 +1,21 @@
1
package ongi.firebase;
2
3
+import com.google.auth.oauth2.GoogleCredentials;
4
import com.google.firebase.FirebaseApp;
5
+import com.google.firebase.FirebaseOptions;
6
import jakarta.annotation.PostConstruct;
7
+import java.io.IOException;
8
import org.springframework.context.annotation.Configuration;
9
10
@Configuration
11
public class FirebaseConfig {
12
13
@PostConstruct
- public void initFirebase() {
- FirebaseApp.initializeApp();
14
+ public void initFirebase() throws IOException {
15
+ FirebaseOptions options = FirebaseOptions.builder()
16
+ .setCredentials(GoogleCredentials.getApplicationDefault())
17
+ .build();
18
+
19
+ FirebaseApp.initializeApp(options);
20
}
21
0 commit comments