Reputation: 5588
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]
Upvotes: 0
Views: 375
Reputation: 87258
By defining your function name as push
, you're overriding the global push
object, which contains the apns
member with a send
function. Try defining the function in your script with a different name.
Upvotes: 3