sandeepmistry / node-ancs

A node.js lib to access the Apple Notification Center Service (ANCS)
MIT License
67 stars 19 forks source link

ancs

Gitter

A node.js lib to access the Apple Notification Center Service (ANCS)

Install

npm install ancs

Prerequisites

Usage

var ANCS = require('ancs');

Discover

ANCS.discover(callback(ancs));

Connect

ancs.connect(callback);

Disconnect

ancs.disconnect(callback);

Notification Event

ancs.on('notification', function(notification) {
    // ...
});

Operations for 'added' or 'modified' notifications (event property)

Read App Identifier

notification.readAppIdentifier(function(appIdentifier) {
  // ...
});

Read Title

notification.readTitle(function(title) {
  // ...
});

Read Subtitle

notification.readSubtitle(function(subtitle) {
  // ...
});

Read Message

notification.readMessage(function(message) {
  // ...
});

Read Date

notification.readDate(function(date) {
  // ...
});

Read All Attributes

notification.readAttributes(function(attributes) {
  // ...
});

Analytics