0

다 큰 후 지금은 다음과 같은 오류가 일하고있다 1.x에서 작동하지 않습니다 :이온 푸시는 더 이상

ionic.bundle.js:18463 OPTIONS 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..."); 
}); 

모든 것이 작동을 멈췄습니다. 이전에는 아름답게 작동했습니다. 당신의 도움이

답변

0

에 대한

덕분에 나는 그들이 URL을 변경하고 약간의 형식을 가지고 생각합니다. [ "device_token_1", "device_token_2"] "프로필": "자극" "통지"{ "

새로운 URL은 https://api.ionic.io/push/notifications

페이

{ "토큰 "인 제목 ":"메시지 제목 ", "message ":"우르 메시지! " } }