PHP code example of alldigitalrewards / pubsub

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

    

alldigitalrewards / pubsub example snippets

bash
* returns array 
* throws PubSubServiceException
$messageConfig = new Message(
    'DEV_TESTSERVICE2_TOPIC',
    'DEV_TESTSERVICE2_SUBSCRIPTION',
);
$message = $messageService->pullMessage($messageConfig)
print_r($message['key1']); //$someValue1
print_r($message['key2']); //$someValue2