Skip to content

Commit 2c73ad3

Browse files
authored
Fix: [FCM] FCM config 수정 (#79)
1 parent 5432bcf commit 2c73ad3

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ public void initialize() {
2929
new java.io.ByteArrayInputStream(firebaseJson.getBytes())
3030
);
3131
} else if (serviceAccountKeyPath != null && !serviceAccountKeyPath.isEmpty()) {
32-
String resourcePath = serviceAccountKeyPath.startsWith("classpath:")
33-
? serviceAccountKeyPath.substring(10)
34-
: serviceAccountKeyPath;
32+
String firebasePath = "firebase/" + serviceAccountKeyPath;
3533
googleCredentials = GoogleCredentials
36-
.fromStream(new ClassPathResource(resourcePath).getInputStream());
34+
.fromStream(new ClassPathResource(firebasePath).getInputStream());
3735
} else {
3836
throw new RuntimeException("Firebase service account key not found. Please set FCM_JSON or FIREBASE_SERVICE_ACCOUNT_KEY");
3937
}

runtracker/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ app:
6767
key: ${AUTH_KEY}
6868

6969
firebase:
70-
service-account-key: classpath:firebase/${FIREBASE_SERVICE_ACCOUNT_KEY:}
70+
service-account-key: ${FIREBASE_SERVICE_ACCOUNT_KEY:}
7171
url: https://fcm.googleapis.com/v1/projects/${Firebase_ID}/messages:send
7272
google_api: https://www.googleapis.com/auth/cloud-platform
7373
project_id: ${Firebase_ID}

0 commit comments

Comments
 (0)