Closed toriqo closed 4 years ago
@toriqo In order to set the payload
property for APN you need to pass your data
object into the custom
property, e.g.
{
title: 'some title',
pushType: 'voip',
alert: 'new pushkit',
custom: {
data: {
Key: {
AnotherKey: 'value',
Key: 'value',
SomeKey: 'value'
}
}
}
}
This is documented in https://github.com/appfeel/node-pushnotifications#apn:
{
...
payload: data.custom || {}
...
}
Thanks. It works.
FYI: I saw the data.custom in the docs but the info is a bit blurry there, as the APN object still has the payload
key in it making me think I have to send it. No mention anywhere about the custom
property.
The
payload
andrawPayload
properties on the notification are not properly formatted as node-apn requires it hereI only need to send this object as a PushKit (VoIP) notification but I can't construct my object properly.
The payload attribute seems to be ignored as it's not forwarding
data
in the notification.Usage example: