Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift Firebase Send Push Notification [duplicate]

Tags:

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!

like image 471
askaale Avatar asked Aug 01 '16 14:08

askaale


1 Answers

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

like image 92
Ramesh Lingappa Avatar answered Nov 04 '22 00:11

Ramesh Lingappa