3
我發送通知給幾個註冊ID從服務器端在PHP中。 這是請求:很多fcm註冊ID失敗時,針對多個registration_ids
public function androidPushNotification($registration_ids, $title, $message) {
$msg = array (
'message' => $message,
'title' => $title
);
$fields = array (
'registration_ids' => $registration_ids,
'data' => $msg
);
$headers = array (
'Authorization: key=' . $this->API_ACCESS_KEY,
'Content-Type: application/json'
);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $this->GCM_URL);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ch, CURLOPT_POSTFIELDS, json_encode ($fields));
$result = curl_exec ($ch);
curl_close ($ch);
return $result;
}
的registration_ids變量陣列中的兩個配準的ID,他們中的一個是從舊安裝在客戶端應用程序的,而另一個是在當前一個。
我碰到這個FCM響應:
{
"multicast_id": 7860323906688398625,
"success": 1,
"failure": 1,
"canonical_ids": 0,
"results": [
{
"error": "NotRegistered"
},
{
"message_id": "0:1478735313889582%1b153de0f9fd7ecd"
}
]
}
我怎麼能知道其註冊ID的失敗?
是否有另一種選擇獲取此信息?
問候!