How to use the @parse/node-apn.Provider 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 parse-community / parse-server-push-adapter / src / APNS.js View on Github external
static _createProvider(apnsArgs) {
    // if using certificate, then topic must be defined
    if (!APNS._validateAPNArgs(apnsArgs)) {
      throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED, 'topic is mssing for %j', apnsArgs);
    }

    let provider = new apn.Provider(apnsArgs);

    // Sets the topic on this provider
    provider.topic = apnsArgs.topic;

    // Set the priority of the providers, prod cert has higher priority
    if (apnsArgs.production) {
      provider.priority = 0;
    } else {
      provider.priority = 1;
    }

    return provider;
  }
github appfeel / node-pushnotifications / src / sendAPN.js View on Github external
constructor(settings) {
    try {
      this.connection = new apn.Provider(settings);
    } catch (e) {
      this.connectionError = e;
      this.connection = null;
    }
  }

@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