I wrote application which uses FCM topic massaging to receive push notifications from server.
My HTTP request is:
https://fcm.googleapis.com/fcm/send
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
{
"to":"/topics/Foo-bar",
"priority":"high",
"content_available": true,
"data":{
"notification-type":"chat",
"target":"Current User",
"title":"Current User has sent you a message",
"text": "hello1",
"badge": 5 //Badge you want to show on app icon
}
}
And I got response as:
{
"message_id": 6199072048907273657
}
But it doesn't receives Notification on device.
And how to print Notification data in debugger??
Payload should be like this. Instead of data use notification object.
{
"to":"/topics/test",
"notification":{
"type":"test",
"title":"test!",
"message":"test"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With