Skip to content

Sending data to topics does not work #816

@genna87

Description

@genna87

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!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions