Если у кого-то возникла такая же проблема, у меня сработало следующее:
добавьте firebase-admin-6.12.2.jar во внешнюю библиотеку и добавьте следующие зависимости в свой build.sbt
"com.google.guava" % "guava" % "28.2-jre",
"com.google.api" % "api-common" % "1.8.1",
"com.google.api-client" % "google-api-client" % "1.30.1",
"com.google.auth" % "google-auth-library-oauth2-http" % "0.20.0"
и следующий код для отправки уведомления с использованием firebase admin
String fcmToken = "";
Message message = Message.builder()
.setNotification(new Notification(
title,
context))
.setToken(fcmToken)
.build();
String response = null;
try {
response = FirebaseMessaging.getInstance(FirebaseApp.initializeApp(getOptions()))
.send(message);
} catch (FirebaseMessagingException e) {
e.printStackTrace();
}
System.out.println("Successfully sent message: " + response);
FirebaseOptions getOptions() {
FileInputStream serviceAccount = null;
FirebaseOptions options =null;
try {
serviceAccount = new FileInputStream("conf/projectPrivateKey.json");
} catch (FileNotFoundException e) {
e.printStackTrace();
}
try {
options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("https://DATABASE_NAME.firebaseio.com")
.build();
} catch (IOException e) {
e.printStackTrace();
}
return options;
}