128
Views
1
Comments
[OneSignal Notification Plugin] get custom data from notification
Question
onesignal-plugin
Mobile icon
Forge asset by Alexandre Costa

I've sent a notification with custom data in the NotificationRequest. However, I'm having trouble retrieving that custom data. I tried to Deserialize the "additionalData" field from the payload structure into the same type of the data that was sent, but to no avail.

Digging into it, I printed the value in the "additionalData" field and it is [object Object], which was very surprising, as I was expecting a json containing all the data I sent.

Am I doing something wrong or is it a bug with the plugin itself?

2019-04-25 02-49-33
Royce

Ricardo Silva wrote:

I've sent a notification with custom data in the NotificationRequest. However, I'm having trouble retrieving that custom data. I tried to Deserialize the "additionalData" field from the payload structure into the same type of the data that was sent, but to no avail.

Digging into it, I printed the value in the "additionalData" field and it is [object Object], which was very surprising, as I was expecting a json containing all the data I sent.

Am I doing something wrong or is it a bug with the plugin itself?


Hi Ricardo,

Good day, are you able to fix this? I'm also having the same issue.

Thank you,

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.