How to use the @parse/node-apn.Notification function in @parse/node-apn

To help you get started, we’ve selected a few @parse/node-apn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appfeel / node-pushnotifications / src / sendAPN.js View on Github external
sendAPN(regIds, data) {
    const message = new apn.Notification({
      retryLimit: data.retries || -1,
      expiry: extractExpiry(data),
      priority: data.priority === 'normal' ? 5 : 10,
      encoding: data.encoding,
      payload: data.custom || {},
      badge: data.badge,
      sound: data.sound,
      alert: data.alert || {
        title: data.title,
        body: data.body,
        'title-loc-key': data.titleLocKey,
        'title-loc-args': data.titleLocArgs,
        'loc-key': data.locKey,
        // bodyLocArgs is kept for backward compatibility
        'loc-args': data.locArgs || data.bodyLocArgs,
        'launch-image': data.launchImage,
github parse-community / parse-server-push-adapter / src / APNS.js View on Github external
static _generateNotification(coreData, headers) {
    let notification = new apn.Notification();
    let payload = {};
    for (let key in coreData) {
      switch (key) {
        case 'aps':
          notification.aps = coreData.aps;
          break;
        case 'alert':
          notification.setAlert(coreData.alert);
          break;
        case 'title':
          notification.setTitle(coreData.title);
        break;
        case 'badge':
          notification.setBadge(coreData.badge);
          break;
        case 'sound':

@parse/node-apn

An interface to the Apple Push Notification service for Node.js

MIT
Latest version published 1 month ago

Package Health Score

87 / 100
Full package analysis