File: testPush.php

Recommend this page to a friend!
  Classes of Christiaan Baartse  >  PHP Google Cloud Messaging Server  >  testPush.php  >  Download  
File: testPush.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Google Cloud Messaging Server
Send messages to Android applications using GCM
Author: By
Last change:
Date: 8 years ago
Size: 494 bytes


Class file image Download
include 'vendor/autoload.php';

EchoLogger extends \Psr\Log\AbstractLogger
    public function
log($level, $message, array $context = array())
sprintf('%s: %s'.PHP_EOL, $level, $message);

$sender = new \WebPower\gcm\server\Sender('api key');
$sender->setLogger(new EchoLogger());

$message = \WebPower\gcm\server\Message::builder();
$message->addData('message', 'Hoi');

$result = $sender->singleSendNoRetry($message->build(), 'reg Id');


For more information send a message to info at phpclasses dot org.