Search code examples
iospush-notificationapple-push-notificationsnode-apn

iOS give notification a title using node-apn


Is there a way to set a bolded notification title (like most apps have) using node-apn? I've tried the following setters:

notification.body = "Body";
notification.title = "Title";
notification.alert = "Alert";

but only the alert is included in the notification and it's in regular text, appearing kind of odd.


Solution

  • You can set the title in the alert object like this

    alert: {
        title: 'heres the title',
        body: 'heres a body'
    }