Azure Mobile Scheduler APNS不发送推送

时间:2013-01-01 05:01:21

标签: apple-push-notifications azure-mobile-services

我有天蓝色的移动服务器,我想使用调度程序作业进行推送通知, 但是,当我运行测试时,它会触发错误。

任何人都能指导我什么是问题和解决方案吗?

Shedular脚本:

        function push() {                       
            setTimeout(function() {
                push.apns.send("XXXXXXdeviceTokenXXXXX", {
                    alert: "Toast: ", badge: 8            
                },{
                    error : function(err) {
                        console.log('error on 123.');
                    }
                });
            }, 2500);    
        }

错误代码:

  

TypeError:无法在Object._onTimeout上调用undefined方法'send'   (:8:19)[外部代码]

1 个答案:

答案 0 :(得分:3)

通过将您的函数名称定义为push,您将覆盖全局push object,其中包含apns成员send的成员。尝试使用其他名称在脚本中定义函数。

相关问题