Skip to content
Merged
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,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()
Expand Down