library phpfcm
PHP API for Firebase cloud message
gfonseca/phpfcm
PHP API for Firebase cloud message
- Monday, October 16, 2017
- by gfonseca
- Repository
- 1 Watchers
- 0 Stars
- 18 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 5 Versions
- 0 % Grown
phpfcm
PHP API for Firebase cloud message
<?php
include __DIR__."/../vendor/autoload.php";
define("CONCURRENCY", 50);
define("ACCESS_TOKEN", "google_access_token");
$client_list; // <=list of clients loaded from database
// You also can use PHPFCM\FCMClient::makeMessagePool()
$pack = PHPFCM\FCMClient::makeNotificationPool(
function($client){
return array(
"to" => $client->token,
"message_options" => array(
"dry_run" => false
),
"notification" => array(
"title" => "Hello {$client->name}!",
"body" => "have a look at our offers, Mr. {$client->last_name}! "
)
);
},
$client_list
);
$fcm = new PHPFCM\FCMClient(
ACCESS_TOKEN,
CONCURRENCY
);
$response = $fcm->sendPack($pack);
foreach($response as $r) {
echo $r->getMessageID();
echo "\n";
}
dev-master
9999999-dev
PHP API for Firebase cloud message
Sources
Download
The Requires
The Development Requires
by
Georgio Barbosa
v0.2.4
0.2.4.0
PHP API for Firebase cloud message
Sources
Download
The Requires
The Development Requires
by
Georgio Barbosa
v0.2.3
0.2.3.0
PHP API for Firebase cloud message
Sources
Download
The Requires
The Development Requires
by
Georgio Barbosa
v0.2
0.2.0.0
PHP API for Firebase cloud message
Sources
Download
The Requires
The Development Requires
by
Georgio Barbosa
v0.1
0.1.0.0
PHP API for Firebase cloud message
Sources
Download
The Requires
The Development Requires
by
Georgio Barbosa