onmyway133 / PushNotifications

🐉 A macOS, Linux, Windows app to test push notifications on iOS and Android
https://onmyway133.com
Other
2.26k stars 176 forks source link

Allow user to send data-only or custom notification payload #54

Closed namnm closed 1 year ago

namnm commented 3 years ago

If payload.data or payload.notification is present, we merge the whole payload to the fcm message object. This will solve the case user need to send data-only or custom notification payload

For eg:

{
  "data": {
    "title": "Title from data-only",
    "body": "Body from data-only",
    // ... Other data fields
  }
}
Ariandr commented 3 years ago

Hi @namnm Thank you for the PR!

Have you done manual testing of the updated logic? Does it work for all cases it worked before?

namnm commented 3 years ago

Hi @Ariandr

I tested a bit with the new logic. Look at the code, it would only affect if the json user put it has data or notification object, in that case we will override those default fields.

If the json has no data or notification object, it would be working as usual.

Ariandr commented 3 years ago

Okay @namnm, but at the moment I cannot test Android notifications personally. If @onmyway133 approves, we will deliver it.

Hi @onmyway133 Please have a look, if everything is okay, I will merge this PR and create a new release.

Ariandr commented 3 years ago

Hi @onmyway133 Do you have a chance to review this PR?

If you approve, I will create a release.

Ariandr commented 1 year ago

Published new release https://github.com/onmyway133/PushNotifications/releases/tag/1.7.9