0

Google の API を使用してプッシュ通知を送信しています。問題は、「http://android.googleapis.com/gcm/send」を使用すると完璧に動作しますが、「https://android.googleapis. com/gcm/send " (http の S 付き) 動作せず、カールが停止します。

誰でも理由を知っていますか?

$headers = array('Authorization:key=' . $apiKey);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 
"http://android.googleapis.com/gcm/send");
if ($headers)
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
4

1 に答える 1