I was wondering how I could send a push notification by code from my app, via Firebase? I am only able to send a push notification from my Firebase Notification-console as of right now, but I would like to figure out how to send one programmatically. Any ideas on where I can find more info on this? Please point me in the right direction! I tried to check out a project on GitHub by Firebase (quickstart), but I have to say that including that project, it's very little information on this. I was lucky to find a tutorial on YouTube that at least allowed me to teach myself how to use remote notifications.
Thanks in advance!
You can, Firebase (formally Cloud Messaging) provides REST API to send push notifications, checkout the following documentation,
https://firebase.google.com/docs/cloud-messaging/downstream
https://firebase.google.com/docs/cloud-messaging/server
You have to construct the payload, generate Server API Key from Firebase Console and send http request to Firebase endpoint (https://fcm.googleapis.com/fcm/send)
And if you are looking for any library, here is the one which works
http://www.java2s.com/Code/Jar/g/Downloadgcmserverjar.htm
it will send push to GCM server, but it works with Firebase too(we are currently using it)
i don't currently find any official SDK provided by firebase to send push notifications
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With