PHP code example of yogradac / facebook-messenger-bundle

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

    

yogradac / facebook-messenger-bundle example snippets



class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Yogradac\FacebookMessengerBundle\FacebookMessengerBundle(),
        );
        // ...
    }
    // ...
}

$messenger = $this->get('facebook_messenger.messenger');
$response = $messenger->broadcast()->create('Hello world');

$messenger->broadcast()->send($response->getMessageCreativeId());