【发布时间】:2013-01-11 08:17:38
【问题描述】:
我正在尝试从服务器发送通知,docs 说要 POST 到 /api/push/broadcast/,这是我通过以下代码完成的
$.ajax({
type: 'POST',
dataType: 'json',
url: 'https://go.urbanairship.com/api/push/?callback=?',
data: '{"android": {"alert": "hi"}}',
contentType: "application/json",
username:"P4...UBg",
password:"fg...gDA",
error: function(jqXHR, textStatus, errorThrown){
// log the error to the console
alert(
"The following error occured: "+
textStatus, errorThrown
);
},
});
我收到 500(内部服务器错误)。我添加了回调以防止“同源策略”错误,如建议的here。有谁知道正确的做法吗?
谢谢
【问题讨论】:
标签: push-notification urbanairship.com