Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion runtracker/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down