I'm trying to configure the Firebase Admin SDK on my Java app. It seems to me that the project_id, client_id and other credentials, is not being entered into the FirebaseOptions.
When I print out the project id, it says it is null, but I don't know what I'm doing wrong.
This is my code:
try {
FileInputStream serviceAccount = new FileInputStream("D:/Documenten/Prive/Projecten/DeLijnNotificatieProject/sample.test/src/main/resources/serviceAccountKey.json");
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("https://delijnapp-e2539.firebaseio.com")
.build();
System.out.println("project_id: " + options.getProjectId());
FirebaseApp.initializeApp(options);
} catch (IOException e){
System.out.println("Probleem bij het laden van serviceaccount");
System.out.println(e.getMessage());
System.exit(1);
}
Geef de code hier op...
Setting up the Realtime Database on my android app, has been successful.
Can someone tell me what I've done wrong?