PHP code example of webdevvie / pushover-bundle

1. Go to this page and download the library: Download webdevvie/pushover-bundle 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/ */

    

webdevvie / pushover-bundle example snippets



    # get the service from the container;
    $pushover = $this->get('pushover');
    
    $message = new PushoverMessage();
    $message->setUser("usercode_here");
    $message->setSound("pushover");
    $message->setTitle("A title here");
    $message->setMessage("Your message here");
    $response = $pushover->sendMessage($message);
    
    # Now you can check on the response object with $response->isSent();
    # any errors are stored in the $response->getErrors() as an array of strings (isSent will then return false)