我试图在移动服务中使用脚本将通知推送到ios移动设备,但我在日志中不断收到脚本错误,但是当从移动设备添加记录时,它正在添加,但通知未发送,可以有人帮我解决了这个错误吗? 这是我在ios的azure中的移动服务选项卡中的脚本:
function insert(item, user, request) {
request.execute();
// Set timeout to delay the notification, to provide time for the
// app to be closed on the device to demonstrate toast notifications
setTimeout(function() {
push.apns.send(item.deviceToken, {
alert: "Toast: " + item.text,
payload: {
inAppMessage: "Hey, a new item arrived: '" + item.text + "'"
}
},
function (error) {
if (!error) {
alert:"msg sent successfully"
}
});
}, 2500);
}