2

My iOS needs to receive a push notification whenever there is a change in Firebase database. Firebase has their own GUI for sending the push notifications to devices. But in my case it has to be automatic and I shouldn't use the GUI of Firebase. I got to know that there should be one custom server for handling this case as Firebase has provided option to make a call for sending push message as mentioned in below link.

How can I send a Firebase Cloud Messaging notification without use the Firebase Console?

So there should be http call from Firebase to notify the custom server for sending push message to devices. I have not found any way to make a http call from Firebse to external servers.

Any help would be thankful.

Community
  • 1
  • 1
RamChandraReddy
  • 239
  • 2
  • 12
  • You will need to run the process to send those messages on your own server. See http://stackoverflow.com/questions/37634046/is-it-possible-to-send-pushnotifications-using-firebase-cloud-messaging-fcm-t/37634914#37634914 – Frank van Puffelen Jun 22 '16 at 14:50
  • Yes I know about that and hence mentioned it in my question. My problem here is to notify the custom server from Firebase to send the push notification. Is there any way to do that? – RamChandraReddy Jun 23 '16 at 06:41
  • 1
    The [Firebase Cloud Messaging documentation](https://firebase.google.com/docs/cloud-messaging/upstream) mentions one way to sending such upstream messages. I personally typically have the app [write its request-to-send-a-message-to-a-user into the Firebase Database](https://firebase.google.com/docs/database/android/save-data) and then have a [node.js script on a server that reads these requests from the database](https://firebase.google.com/docs/database/server/start) and calls FCM. – Frank van Puffelen Jun 23 '16 at 15:56
  • @FrankvanPuffelen do you store the user's device registration token into the realtime database to find the device to send the message to? – Hellojeffy Aug 01 '16 at 23:01
  • Yes. Or define a topic for each user and send to that topic. See http://stackoverflow.com/questions/38678599/android-fcm-subtopics/38679279#38679279 – Frank van Puffelen Aug 01 '16 at 23:20

0 Answers0