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
1 answer
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
|