【发布时间】:2015-08-12 06:47:40
【问题描述】:
我的 Ionic 应用程序出现问题。我正在尝试使用 Rest API 通过 Parse 发送推送通知。我可以使用他们的推送控制台成功发送通知。
但是,以下函数会引发错误代码 115 和一条消息“错误:“缺少推送数据。”如果您需要任何其他信息来解决此问题,请告诉我。
谢谢。
$scope.send = function()
{
$http({
url: "https://api.parse.com/1/push",
method: "POST",
data: {
"alert": "Alert Message", //not platform specific
"badge": "1", //platform specific iOS
"sound": "", //platform specific iOS
"channels":["test"]
},
headers: {
"X-Parse-Application-Id": "removed",
"X-Parse-REST-API-Key": "removed",
"Content-Type": "application/json"
}
}).success(function (data, status, headers, config) {
console.log("Push sent!");
//alert('iOS registered success = ' + data + ' Status ' + status);
}).error(function (data, status, headers, config) {
console.log(config)
});
};
【问题讨论】:
标签: javascript parse-platform push-notification ionic-framework