NovuN
Novuβ€’3y ago
serafeimo

FCM notification & data objects (v0.11.0)

Hi all!

I know that there are a couple of discussions about this subject but I created this one hoping to clear things out a little bit.

As I've seen from FCM documentation (v1), while sending a message, one can specify two objects: notification, data.
For example:
{
    "message": {
            "token": "device-token",
            "notification": {
                "body" : "Title here",
                "title": "Message body"
            },
            "data": {
                "action": "go_to_link",
                "url": "https://www.novu.com"
            }
        }
}


However, from my testing with Novu so far, when I add the data type in the overrides field, it sends the data but it omits the title&message fields from the template. So, the data fields are sent to the device but the message is empty..

Event trigger example:
{
    "name": "fcm-test",
    "to": {
        "subscriberId": "sera-12345"
    },
    "payload": {
        "title": "Title here",
        "body": "I am the body",
        "action": "go_to_link",
        "url": "https://www.novu.com"
    },
    "overrides": {
        "fcm": {
            "type": "data"
        }
    }
}


I'd appreciate any comments or thought on this πŸ˜…

Thanks!
Was this page helpful?