Пример #1
0
 /**
  * @return $this
  */
 public function connect()
 {
     parent::connect();
     $ch = $this->curl;
     $headers = [];
     $headers['Content-Type'] = 'application/json';
     $headers['Authorization'] = 'key=' . $this->auth->apiKey;
     curl_setopt($ch, CURLOPT_URL, 'https://gcm-http.googleapis.com/gcm/send');
     curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
     return $this;
 }
Пример #2
0
 /**
  * @return $this
  */
 public function connect()
 {
     parent::connect();
     $ch = $this->curl;
     curl_setopt($ch, CURLOPT_HTTP_VERSION, 3);
     curl_setopt($ch, CURLOPT_SSLCERT, $this->auth->certificate);
     curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $this->auth->passPhrase);
     curl_setopt($ch, CURLOPT_SSLKEY, $this->auth->certificate);
     curl_setopt($ch, CURLOPT_SSLKEYTYPE, 'PEM');
     curl_setopt($ch, CURLOPT_SSLKEYPASSWD, $this->auth->passPhrase);
     return $this;
 }