Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mpns

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mpns - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

42

lib/mpns.js

@@ -18,4 +18,4 @@ // Copyright Jeff Wilcox

//
// This library is designed for Windows Phone 7.1 and 8.0 OS. To send push to
// a 7.0 device, the developer must not include the param value (toast) or
// This library is designed for Windows Phone 7.1 and 8.0 OS. To send push to
// a 7.0 device, the developer must not include the param value (toast) or
// any of the advanced back background tile images (tiles).

@@ -102,3 +102,3 @@

// Store the fields that were sent to make it easy to log.
copyOfInterest(me, result, propertiesOfInterest,
copyOfInterest(me, result, propertiesOfInterest,
this.pushType === 'tile');

@@ -151,2 +151,12 @@

req.on('error', function(e)
{
result.minutesToDelay = ERROR_MINIMUM_DELAY_MINUTES; // Just a recommendation.
err = result;
err.innerError = e;
if (callback)
callback(err);
});
// Send the push notification to Microsoft.

@@ -207,3 +217,3 @@ req.write(payload);

function getPushHeader(type, attributes) {
return '<?xml version="1.0" encoding="utf-8"?><wp:Notification xmlns:wp="WPNotification">' +
return '<?xml version="1.0" encoding="utf-8"?><wp:Notification xmlns:wp="WPNotification">' +
startTag(type, attributes);

@@ -242,6 +252,6 @@ }

var type = 'Toast';
return getPushHeader(type) +
wrapValue(options, 'text1', 'Text1') +
wrapValue(options, 'text2', 'Text2') +
wrapValue(options, 'param', 'Param') +
return getPushHeader(type) +
wrapValue(options, 'text1', 'Text1') +
wrapValue(options, 'text2', 'Text2') +
wrapValue(options, 'param', 'Param') +
getPushFooter(type);

@@ -252,3 +262,3 @@ }

var type = 'Tile';
return getPushHeader(type, tileGetAttributes(options)) +
return getPushHeader(type, tileGetAttributes(options)) +
wrapValue(options, 'backgroundImage', 'BackgroundImage') +

@@ -260,3 +270,3 @@ wrapValue(options, 'count', 'Count') +

wrapValue(options, 'backContent', 'BackContent') +
wrapValue(options, 'smallbackgroundImage', 'SmallbackgroundImage') +
wrapValue(options, 'smallBackgroundImage', 'SmallBackgroundImage') +
wrapValue(options, 'wideBackgroundImage', 'WideBackgroundImage') +

@@ -298,6 +308,6 @@ wrapValue(options, 'wideBackContent', 'WideBackContent') +

if (typeof pushUri !== 'string')
if (typeof pushUri !== 'string')
throw new Error('The pushUri parameter must be the push notification channel URI string.');
var params = {};
var params = {};
if (typeof args[0] === 'object') {

@@ -317,6 +327,6 @@ var payload = Array.prototype.shift.apply(args);

if (type == 'toast' && typeof params.text1 !== 'string')
if (type == 'toast' && typeof params.text1 !== 'string')
throw new Error('The text1 toast parameter must be set and a string.');
if (type == 'tile' && Object.keys(params).length == 0)
if (type == 'tile' && Object.keys(params).length == 0)
throw new Error('At least 1 tile parameter must be set.');

@@ -350,3 +360,3 @@

var flipTileProperties = tileProperties.concat([
'smallbackgroundImage',
'smallBackgroundImage',
'wideBackgroundImage',

@@ -360,3 +370,3 @@ 'wideBackContent',

// These object constructors are effectively deprecated. Consider using
// These object constructors are effectively deprecated. Consider using
// sendToast, sendTile or sendRaw methods going forward.

@@ -363,0 +373,0 @@ exports.liveTile = LiveTile;

{
"name": "mpns",
"description": "A Node.js interface to the Microsoft Push Notification Service (MPNS) for Windows Phone.",
"version": "1.2.3",
"version": "1.2.4",
"author": "Jeff Wilcox <jeffwilcox+github@gmail.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -65,3 +65,3 @@ #mpns

Some devices support an enhanced tile format called a "flip tile", which supports some additional parameters. This kind of tile can be sent using the `sendFlipTile` method, which supports *all of the above* parameters as well as:
* `smallbackgroundImage` URI to the background image for the tile when it is shrunk to small size
* `smallBackgroundImage` URI to the background image for the tile when it is shrunk to small size
* `wideBackgroundImage` URI to the background image for the tile when it is expanded to wide size

@@ -152,2 +152,11 @@ * `wideBackContent` content for the back tile (appears in a larger font size) when the tile is expanded to wide size

1.2.4:
* Fixes a small typo in smallBackgroundImage (thanks @rs)
* Adds error handling when URLs cannot be resolved
1.2.3:
* Uses `url.parse` to support hostnames with ports
1.2.2:

@@ -154,0 +163,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc