iOS 使用 node-apn 给通知一个标题

rha*_*ing 2 push-notification apple-push-notifications ios node-apn

有没有办法使用 node-apn 设置粗体通知标题(就像大多数应用程序一样)?我尝试了以下设置器:

notification.body = "Body";
notification.title = "Title";
notification.alert = "Alert";
Run Code Online (Sandbox Code Playgroud)

但只有警报包含在通知中,并且是常规文本,看起来有点奇怪。

Bra*_*ter 5

您可以像这样在警报对象中设置标题

alert: {
    title: 'heres the title',
    body: 'heres a body'
}
Run Code Online (Sandbox Code Playgroud)