itisnajim / strapi-plugin-fcm

Send FCM notifications from your Strapi app.
MIT License
22 stars 11 forks source link

Fix: Parse payload to json before adding it #11

Closed deBasMan21 closed 1 year ago

deBasMan21 commented 1 year ago

When adding a payload to the push notification it tries to add the payload as a string instead of a json object. This causes an error and it doesn't send the notification at all.

I added a step that parses the json and if it succeeds it adds the json to the payload. If it fails it will continue with sending the notification. This fixes my issue and with this fix i can add payloads to the notifications.

@itisnajim Please let me know if you think this is a good solution or if you have a better solution for this.

deBasMan21 commented 1 year ago

@itisnajim can you please take a look at it?