Notify My Android from Node.js
Notify My Android is a push message service and app for Android phones. This module provides easy to use methods for communicating with its API, allowing you to send notifications to your (or someone else's) Android phone from node.js.
node-notifymyandroid respects the API's rate limiting and manages this automagically, so you don't have to do anything! When the rate limit is reached, an error will be emitted.
Installation
npm install node-notifymyandroid
Super Simple Examples
The Notify My Android API provides 2 endpoints; one for checking the validation of an API key and one to send a notification.
Example to check if the provided API key is valid
var Notifier = Notifier;var notifier = 'Application Name' 'Your developer key, if you have one. This is optional.'; notifier;
Example of how to send a notification
var Notifier = Notifier;var notifier = 'Application Name' 'Your developer key, if you have one. This is optional.'; // All options are optionalvar options = priority: 2 // The priority of the notification (-2 to 2, default is 0) url: 'http://github.com/MichielvdVelde/node-notifymyandroid' // The URL to include contentType: 'text/html' // To allow basic HTML tagsnotifier;
Changelog
- V 1.0.1
- Fixed parse XML body error callback
- V 1.0.0
- Rewritten code, added all currently available API options and documented functions
- V 0.1.4
- Fixed notifier.getRemainingCalls
- V 0.1.3
- Fixed notifier.hasCallsRemaining
- V 0.1.2
- Now supports notifier.isValidKey('another key here', function(err, valid) { }) to check the validity of a different key than when the object was created
- Made notifier.hasCallsRemaining() available to check if the IP address still has calls remaining (returns a boolean)
License
Copyright 2017 Michiel van der Velde.
Licenced under the MIT License.