npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

afpushnotificationservicesdk-nodejs

v0.1.5

Published

appfarms push notification service - nodeJS SDK

Downloads

2

Readme

AFPushNotificationServiceSDK-nodeJS

npm package

A small library providing utility methods to send iOS and Android Push Notifications via the appfarms push notification service (http://push.appfarms.com). In current version you can provide an array of filters to select destination devices. We are working on a version where you can push to a given device token.

Prerequirements

You need to create an REST API Key from the appfarms push notification service (http://push.appfarms.com). If you do not have yet, you will need to create a new Account on this website and subsribe to the service plan of the appfarms push notification service.

Installation

npm install afpushnotificationservicesdk-nodejs --save

Usage

var afpushservice = new AFPushService()
afpushservice.on("success", (result) => {
    console.log(result.statusCode);
    console.log(result.toJSON());
});

afpushservice.on("error", (error) => {
    console.log("error: "+error);
});
var apiKey = "09f3eb8e44e0a6b65ca4d43f139a8d36";
afpushservice.sendPushNotification(apiKey, null, "Neue Nachricht", null, null);

sendPushNotification

Parameter:

  • $1 -> APIKey
  • $2 -> title of push notification (optional)
  • $3 -> message of push notification
  • $4 -> custom payload as array (optional)
  • $5 -> filter as array (optional)

Filter

[
  {
    „key“: id of app key,
    „operator“: 1 for >, 2 for <, 3 for >=, 4 for <=, 5 for ==, 6 for !=, 7 for between, 8 for like,
    „op2“: „value“,
    „op3“: „only for between (operator 7)“
  },
  ...
]

Example (will send a notification to everyone who has app version = 2.0":

[
  {
    „key“: 26, // 26 for APP_VERSION_NAME
    „operator“: 5,
    „op2“: „2.0“
  }
]

Payload

[
  {
    „key“: key of an payload object
    „value“: "value" 
  },
  ...
]

Example:

[
  {
    „key“: "article_id", // 26 for APP_VERSION_NAME
    „value“: 5
  },
  {
    „key“: "more_information", // 26 for APP_VERSION_NAME
    „value“: {
      "test" : "test"
    }
  }
]

License

This module is licensed under the MIT license.

Release History

  • 0.1.3 Initial release