【发布时间】:2017-02-08 12:12:59
【问题描述】:
一切都很好,然后我收到以下错误:
ionic.bundle.js:18463 选项https://push.ionic.io/api/v1/push net::ERR_NAME_NOT_RESOLVED
我似乎无法使用以下方式发送推送:
// Encode your key
var auth = btoa(privateKey + ':');
// Build the request object
var req = {
method: 'POST',
url: 'https://push.ionic.io/api/v1/push',
headers: {
'Content-Type': 'application/json',
'X-Ionic-Application-Id': appId,
'Authorization': 'basic ' + auth
},
data: {
"tokens": devices,
"notification": {
"alert": message,
"ios":{
"priority": 10,
"badge": 1,
"payload": {"path": path}
}
}
}
};
// Make the API call
$http(req).success(function(resp){
// Handle success
console.log("Ionic Push: Push success!");
}).error(function(error){
// Handle error
console.log("Ionic Push: Push error...");
});
一切都停止了工作 - 它以前工作得很好。
感谢您的帮助
【问题讨论】:
标签: ionic-framework push-notification cordova-plugins ionic.io