【问题标题】:Ionic Push is no longer working 1.x离子推送不再工作 1.x
【发布时间】: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


    【解决方案1】:

    我认为他们稍微更改了 URL 和格式。

    新网址是https://api.ionic.io/push/notifications

    有效载荷

    { “令牌”:[“device_token_1”,“device_token_2”], “个人资料”:“产品”, “通知”: { "title" : "消息的标题", “消息”:“你的消息!” } }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-21
      • 2017-01-25
      • 1970-01-01
      相关资源
      最近更新 更多