0

I am running the following code for sending push message to only one device using 'alias' but message being sent to all installations, what could be wrong, can anybody help please?

Here is the code:

var agSender = require( "./lib/unifiedpush-node-sender" ),
    message,
    settings,
    options;

//Send a Message
settings = require( "./settings.json" );

message = {
    alert: "Hello AG Test"    
};

options = {
    config: {
        ttl: 3600,
    },
    criteria: {
        alias: ["xyz123@gmail.com"]
    }
};

agSender.Sender( settings ).send( message, options )
    .on( "success", function( response ) {
        console.log( "success called", response );
    })
    .on( "error", function( err ) {
        console.log( err );
    });

output:
success called Job submitted

JohnnyHK
  • 305,182
  • 66
  • 621
  • 471
ASESA
  • 11
  • 1
  • have you checked the logs on the aerogear server? –  Jun 25 '15 at 19:43
  • Yes I checked, message received for all installations – ASESA Jun 25 '15 at 19:52
  • what version of the sender are you using. Also, can you make sure that on your UnifiedPush Server, the installations in question do have separate alias's – lholmquist Jun 26 '15 at 15:29
  • We are using version 2.0, yes alias setting being added to Installations. Java Sender able to send properly – ASESA Jun 26 '15 at 17:02
  • there isn't actually a version 2.0 for the node version. latest on npm is 0.8.0-beta1. What version of the push server are you using, I've created this JIRA issue, https://issues.jboss.org/browse/AGPUSH-1459 to track it. – lholmquist Jun 27 '15 at 18:46
  • Yes, we are using latest npm is 0.8.0-beta1, with git repo: https://github.com/aerogear/aerogear-unifiedpush-nodejs-client – ASESA Jun 30 '15 at 11:09

1 Answers1

0

You might have a version mismatch. The 1.0.x version of the UnifiedPush Server needs the 0.7.x series of the Node sender.

If you are using the 1.1.x series of the Unified Push server, then use the 0.8.x version

lholmquist
  • 143
  • 7