I have built spring java service using API logic in firebase cloud messaging.
Here is the URL for sample spring service https://github.com/petya0111/firebase-spring-service
Reproduce: set the request
Run project
POST http://localhost:8080/notification/messages
Headers:
firebase-server-key : [your generated server key]
Body:
{
"condition": " 'topic' in topics",
"title": "Hello,Via Multiple Topics",
"body": "Hello,Via Multiple Topics"
}
To send messages to condition you must first create topic
Reproduce: create topic
POST https://iid.googleapis.com/iid/v1/{token}/rel/topics/{topic}
headers
Authorization : key=[firebase-server-key]
200 OK
According to the API's documentation, condition field is defined as case-insensitive. But in practice, it is actually case sensitive.
I am doing two tests with the same topic name (using upper and lower case chars). The original name of the topic I'm trying to send a message is defined as "Topic". Since the field must be case-insensitive, I am trying to use "topiC" and it should still send the message. Unfortunately, it doesn't. The field is actually case-sensitive and this is a huge problem from my perspective.
My second question:
When a non-existent topic is presented. Exchange with URL https://fcm.googleapis.com/fcm/send doesn't return an error.
My third question on this topic is: Condition OR '||'
"condition": " 'topicChrome' in topics || 'topicFirefox' in topics "
is not working, I have subscribed one token on topic 'topicChrome' and another token on topic 'topicFirefox'.