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"]、 "プロファイル": "PROD"、 "通知":{ 「

新しいURLは、https://api.ionic.io/push/notifications

ペイロード

{ "トークン" でありますタイトル ":"メッセージのタイトル "、 "メッセージ ":" Urメッセージ! " } }

関連する問題