File tree Expand file tree Collapse file tree
runtracker/src/main/java/com/runtracker/global/fcm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,11 +29,13 @@ 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 ;
3235 googleCredentials = GoogleCredentials
33- .fromStream (new ClassPathResource (serviceAccountKeyPath ).getInputStream ());
36+ .fromStream (new ClassPathResource (resourcePath ).getInputStream ());
3437 } else {
35- googleCredentials = GoogleCredentials
36- .fromStream (new ClassPathResource ("firebase/runtracker-a30bb-firebase-adminsdk-fbsvc-9479026564.json" ).getInputStream ());
38+ throw new RuntimeException ("Firebase service account key not found. Please set FCM_JSON or FIREBASE_SERVICE_ACCOUNT_KEY" );
3739 }
3840
3941 FirebaseOptions options = FirebaseOptions .builder ()
You can’t perform that action at this time.
0 commit comments