0

Hi I wish to send push messages to specific client from android app. So far it was successful from postman. But how can I translate post to android app?

I need to send post to: https://fcm.googleapis.com/fcm/send

And this is sample message:

{
 "to" : "dLVCgODdwqw:APA91bHz3kb0kyhs0sdf8THHE0DsdfVtHM5Z",
 "collapse_key" : "type_a",
 "notification" : {
     "body" : "Body",
     "title": "Title"
 },
 "data" : {
     "body" : "Body of Notification in Data",
     "title": "Title of Notification in Title",
     "key_1" : "Value for key_1",
     "key_2" : "Value for key_2"
 }
}
KENdi
  • 7,576
  • 2
  • 16
  • 31
Dim
  • 4,527
  • 15
  • 80
  • 139
  • 1
    *`Hi I wish to send push messages to specific client from android app.`* Yes that is possible but **[its very bad idea](https://stackoverflow.com/questions/38432243/how-to-send-device-to-device-notification-by-using-fcm-without-using-xmpp-or-any#comment64284832_38434366)** – AskNilesh Oct 31 '18 at 12:58
  • Why is that a bad idea? – Dim Oct 31 '18 at 13:05
  • 1
    Read comment of `Frank van Puffelen` that i have added link of that comment in my above comment https://stackoverflow.com/questions/38432243/how-to-send-device-to-device-notification-by-using-fcm-without-using-xmpp-or-any#comment64284832_38434366 – AskNilesh Oct 31 '18 at 13:06
  • You can use `Firebase Cloud Functions` to send notifications from one device to another. That is safe and recommend way to do task like that. – Yupi Oct 31 '18 at 13:13

0 Answers0