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