I am trying to send cloud messages to users who subscribe to several topics through an API call (POST https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send ) with the following authority:
{ headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer MY_ACCESS_TOKEN` }, body: { "message": { "condition": "'cat' in topics || 'dog' in topics", "notification": { "title": "Message Title", "body": "Message Body" } } } }
I wrote this configuration in accordance with the FCM documentation . I can get an answer like this:
{ "name": "projects/myproject-b5ae1/messages/5735743068807585451" }
but no devices received messages.
I used an access token for other APIs that works. I also know that the FCM documentation also provided another authority for the cURL request, which I also tried but did not work.
Itβs strange if I provide only one subject in condition , the message is really successfully sent to devices with a subscription. Am I writing something wrong?
I already referred to other solutions in Stackoverflow, but still not working:
Firebase API with multiple themes in state
How to send FCM Push alerts on multiple topics
source share