Ionic Push больше не работает 1.x
Все работало отлично, теперь я получаю следующую ошибку:
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...");
});
все просто перестало работать - раньше все работало прекрасно.
Спасибо за вашу помощь
1 ответ
Я думаю, что они немного изменили URL и формат.
Новый URL-адрес https://api.ionic.io/push/notifications
полезная нагрузка
{ "tokens":["device_token_1", "device_token_2"], "profile": "prod", "messages": { "title": "Заголовок сообщения", "message": "Ur message!" } }