Home > pusher

Push notification Android Php

Hey, Today we learn how to send push notification for android in php. First create a class with following code <?php class Pusher{ const GOOGLE_GCM_URL = 'https://android.googleapis.com/gcm/send'; private $apiKey; private $proxy; private $output; public function __construct($apiKey, $proxy = null) { $this->apiKey = 'your_key'; $this->proxy = $proxy; } /** * @param string|array $regIds * @param string $data * @throws Exception */ public function notify($regIds, $data) { // pr($data); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,

Read More