3

I'm developing a Java Desktop App, using Javafx and I'm trying to receive push notifications from a server. My first approach was to use firebase. I already connected to firebase and even achieve, for test purpose, storing data in firebase database. But the goal I really need is to receive push notifications.

I'm using firebase-admin:6.5.0, but this module doesn't provide me the FirebaseMessagingService class that I need to receive notifications.

I also tried to use firebase-messaging but appear with an error underline after de import.

enter image description here

What I'm doing wrong? It´s even possible to receive push notifications in a Java Desktop app with firebase? What alternative do I have?

Thank you in advance

João Costa
  • 87
  • 3
  • 13

2 Answers2

4

There is no SDK to receive Firebase Cloud Messaging notifications in a Java client. Consider using another technology to deliver the notifications, such as the Firebase Realtime Database, or Cloud Firestore.

The Admin SDK you use grants fill administrative access to your entire Firebase project. It is meant for use on trusted environments, such as your development machine, or a server you control.

Also see:

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Hi Frank, thank you for your reply. I'm trying to use Firebase Realtime Database. I can insert and retrieve data but is possible to have a listener to detect when data is updated – João Costa Oct 02 '18 at 16:37
  • Yes. If you add a listener with `addChildEventListener` or `addValueEventListener` it should be called for the current data *and* for subsequent changes. See https://firebase.google.com/docs/database/admin/retrieve-data#section-event-types. If that doesn't work, you might want to post a new question with the [minimal code that reproduces where you are stuck](http://stackoverflow.com/help/mcve). – Frank van Puffelen Oct 02 '18 at 16:44
0

ControlsFX provides the GUI support for notification ControlsFX

trilogy
  • 1,738
  • 15
  • 31