I am facing a tragic issue while calling FCM API:- In brief When I am calling the API with following:
URL:-https://fcm.googleapis.com/fcm/send
Content-Type:application/json
Authorization:key=AAAA4Kkj8iw:APA91bE......vE4Hxg
{
"condition" : "'Software' in topics",
"data":{
"title":"Title",
"message":"Hello,Via Multiple Topics"
}
}
It works Fine and I got the notification on device from which I have subscribed to topic "Software", But when I go for multiple topics and change the body to
{
"condition" : "'Software' in topics || 'IOT' in topics",
"data":{
"title":"Title",
"message":"Hello,Via Multiple Topics"
}
}
then I don't get the notification I have tested it on POSTMAN it shows that message was sent but I don't receive any notification on my device.
This is the right way as per the Firebase Documentation:
https://fcm.googleapis.com/fcm/send
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
{
"to": "/topics/foo-bar",
"data": {
"message": "This is a Firebase Cloud Messaging Topic Message!",
}
}
https://fcm.googleapis.com/fcm/send
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
{
"condition": "'dogs' in topics || 'cats' in topics",
"data": {
"message": "This is a Firebase Cloud Messaging Topic Message!",
}
}
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