[OneSignal Notification Plugin] get custom data from notification

[OneSignal Notification Plugin] get custom data from notification

  
Forge Component
(5)
Published on 2016-12-14 by Alexandre Costa
5 votes
Published on 2016-12-14 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?

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,