PHP code example of ardabeyazoglu / php-push-helper
1. Go to this page and download the library: Download ardabeyazoglu/php-push-helper library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ardabeyazoglu / php-push-helper example snippets
$fcmApiKey = "YOUR_FCM_API_KEY";
$push = new \Push\Client();
$push->setFcm($fcmApiKey);
// send using fcm
$regToken = "YOUR_DEVICE_TOKEN";
$result = $push->emit($regToken, array(
"title" => "Test push title",
"body" => "That's it!",
"custom" => "my custom data"
));