cURL(stream_socket_clientではなく)を使用してPHPで実装する方法はありますか?cURLを使用したAppleプッシュ通知
は私が書いた:
$url = 'https://gateway.sandbox.push.apple.com:2195';
$cert = 'AppCert.pem';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSLCERT, $cert);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, "passphrase");
$curl_scraped_page = curl_exec($ch);
しかし、どのようにトークンデバイスとJSONメッセージを設定しますか?
なぜ、容易に利用可能なライブラリを見ていない> http://www.easyapns.com/ – BenM
@BenM私はそれのでstream_socket_client機能を使用したくないので、プロキシオプションをsslプロトコルで使用することはできません – Pierre