PHP code example of iakio / gntp-notify

1. Go to this page and download the library: Download iakio/gntp-notify 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/ */

    

iakio / gntp-notify example snippets

:php

$gntp = new GNTP();
$gntp->sendNotify("appname", "type", "title", "text", array('icon_file' => 'a.png'));
:php

$gntp = new GNTP();
$register = new RegisterRequest("appname");
$register->addNotification("type1", array("icon_url" => "http://localhost/a.png");
$register->addNotification("type2", array("icon_file" => "b.png");
$notify = new NotificationRequest("appname", "type1", "title", array("text" => "text");

$gntp->notifyOrRegister($notify, $register);