Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: FCM data-type notification expect a message property in the payload #4639

Closed
2 tasks done
cherfia opened this issue Oct 24, 2023 · 1 comment
Closed
2 tasks done
Assignees
Labels

Comments

@cherfia
Copy link
Contributor

cherfia commented Oct 24, 2023

📜 Description

Currently, when sending a data-type notification, it lacks the push message content that was initially set during the push provider configuration step in the workflow. After inspecting the code below

data: { ...payload, title: options.title, body: options.content },

It turned out that it uses the body property instead of message.

According to Expo documentation, as stated in Send notifications with FCM & APNs, the correct property to use should be message rather than body. I further confirmed this by introducing a custom field labeled message to the payload given that the data property essentially combines the different payload and overrides properties. It worked, however, the drawback is that the message property originated from the backend, which implies that we would be unable to configure it within the workflow, templates, and internationalization (i18n).

👟 Reproduction steps

curl --location --request POST 'https://eu.api.novu.co/v1/events/trigger' \
--header 'Authorization: ApiKey <REPLACE_WITH_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
         "name": "space-membership-request",
         "to": {
           "subscriberId": "4e4bcfe9-1b9e-4383-9784-7d36572adfd3"
         },
         "payload": {
           "data": {
             "user": {
               "id": "345a91b3-941b-4274-8e33-49485c4d7cda",
               "full_name": "Luigi",
             },
             "space": {
               "id": "c1c1989b-1b51-489b-9219-57274a8d65cb",
               "name": "super-mario-bros-wonder",
               "title": "Super Mario Bros. Wonder",
             },
             "request_message": "Mama mia!",
             "request_datetime": "2023-10-23T14:55:58.976406"
           },
           "notification_type": "SPACE_MEMBERSHIP_REQUEST",
           "notification_version": "1.0.0"
         },
         "overrides": {
          "type": "data",
           "fcm": {
            "type": "data"
           }
         },
         "tenant": null
}'

👍 Expected behavior

expected

👎 Actual Behavior with Screenshots

actual

Novu version

Novu SaaS

npm version

No response

node version

No response

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

Yes I am willing to submit a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant