I have azure mobile server and i want push notification using scheduler job,
But when i run for testing it fires an error.
Can any one guide me what is problem and solution ?
Shedular Script:
function push() {
setTimeout(function() {
push.apns.send("XXXXXXdeviceTokenXXXXX", {
alert: "Toast: ", badge: 8
},{
error : function(err) {
console.log('error on 123.');
}
});
}, 2500);
}
ERROR Code:
TypeError: Cannot call method ‘send’ of undefined at Object._onTimeout
(:8:19) [external code]
By defining your function name as
push, you’re overriding the globalpushobject, which contains theapnsmember with asendfunction. Try defining the function in your script with a different name.