gorush
gorush copied to clipboard
Sending data to topics does not work
Trying to send a notification to Android apps.
Using topics, the data field is not populated, using a list of tokens data is populated as expected. In both cases the expected devices get the notification, but using topic the function com.google.firebase.messaging.RemoteMessage getData() returns null.
Here you can find two sample payloads:
{
"notifications": [
{
"topic": "mytopic",
"platform": 2,
"time_to_live": 360,
"data": {
"key1": "val1",
"key2": "val2",
"key3": "val3"
}
}
]
}
{
"notifications": [
{
"tokens": ["mytoken"],
"platform": 2,
"time_to_live": 360,
"data": {
"key1": "val1",
"key2": "val2",
"key3": "val3"
}
}
]
}
THANKS!
The only one here with this problem?
@genna87 Hi. I have encountered your problem. How did you fix it?
Sending data to topic is available? @appleboy
@iAbbos as of now I'm still sending notifications to a batch of tokens
Still waiting for a fix
I will take it.