Wrote a chat on firebase, now you need to decide to send push notifications, previously used a bunch of php / mysql, but here is more intensive information, advise how you can send push directly through firebase

  • this is not something I need from one device to another on a straight line - OPTIMIST .KZ
  • 2
    You need to know its token to send to a specific device. - Kirill Stoianov

1 answer 1

pushes can be sent by the rest client, which means it is possible to implement a POST request from the android device.

url

https://fcm.googleapis.com/fcm/send 

headlines

 Content-Type:application/json Authorization:key=... 

key - Server key (legacy token) (taken from the firebase console)

approximate body:

 { "from":"...", "to":"...", "data": { "text": "Hello" }, "time_to_live": 108 } 

from - sender id, also from the firebase console

to - receiver's token

In the receiver you will need to process it - pull the text out of remoteMessage.getData () and implement your logic

  • Thank you very much for the clear answer! - OPTIMIST .KZ