diff --git a/runtracker/src/main/java/com/runtracker/global/fcm/FirebaseConfig.java b/runtracker/src/main/java/com/runtracker/global/fcm/FirebaseConfig.java index a03732b..1d2249a 100644 --- a/runtracker/src/main/java/com/runtracker/global/fcm/FirebaseConfig.java +++ b/runtracker/src/main/java/com/runtracker/global/fcm/FirebaseConfig.java @@ -29,11 +29,9 @@ public void initialize() { new java.io.ByteArrayInputStream(firebaseJson.getBytes()) ); } else if (serviceAccountKeyPath != null && !serviceAccountKeyPath.isEmpty()) { - String resourcePath = serviceAccountKeyPath.startsWith("classpath:") - ? serviceAccountKeyPath.substring(10) - : serviceAccountKeyPath; + String firebasePath = "firebase/" + serviceAccountKeyPath; googleCredentials = GoogleCredentials - .fromStream(new ClassPathResource(resourcePath).getInputStream()); + .fromStream(new ClassPathResource(firebasePath).getInputStream()); } else { throw new RuntimeException("Firebase service account key not found. Please set FCM_JSON or FIREBASE_SERVICE_ACCOUNT_KEY"); } diff --git a/runtracker/src/main/resources/application.yml b/runtracker/src/main/resources/application.yml index 68fba4b..258337d 100644 --- a/runtracker/src/main/resources/application.yml +++ b/runtracker/src/main/resources/application.yml @@ -67,7 +67,7 @@ app: key: ${AUTH_KEY} firebase: - service-account-key: classpath:firebase/${FIREBASE_SERVICE_ACCOUNT_KEY:} + service-account-key: ${FIREBASE_SERVICE_ACCOUNT_KEY:} url: https://fcm.googleapis.com/v1/projects/${Firebase_ID}/messages:send google_api: https://www.googleapis.com/auth/cloud-platform project_id: ${Firebase_ID}