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 df7411f..a03732b 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,13 @@ public void initialize() { new java.io.ByteArrayInputStream(firebaseJson.getBytes()) ); } else if (serviceAccountKeyPath != null && !serviceAccountKeyPath.isEmpty()) { + String resourcePath = serviceAccountKeyPath.startsWith("classpath:") + ? serviceAccountKeyPath.substring(10) + : serviceAccountKeyPath; googleCredentials = GoogleCredentials - .fromStream(new ClassPathResource(serviceAccountKeyPath).getInputStream()); + .fromStream(new ClassPathResource(resourcePath).getInputStream()); } else { - googleCredentials = GoogleCredentials - .fromStream(new ClassPathResource("firebase/runtracker-a30bb-firebase-adminsdk-fbsvc-9479026564.json").getInputStream()); + throw new RuntimeException("Firebase service account key not found. Please set FCM_JSON or FIREBASE_SERVICE_ACCOUNT_KEY"); } FirebaseOptions options = FirebaseOptions.builder()