PHP code example of samlitowitz / facebook-php-business-sdk-guzzle-adapter

1. Go to this page and download the library: Download samlitowitz/facebook-php-business-sdk-guzzle-adapter 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/ */

    

samlitowitz / facebook-php-business-sdk-guzzle-adapter example snippets


Api::init(
	self::APP_ID,
	self::APP_SECRET,
	self::PAGE_ACCESS_TOKEN
);
$facebookClient = Api::instance()->getHttpClient();
$guzzleClient = new Client();
Api::instance()->getHttpClient()->setAdapter(new GuzzleAdapter($facebookClient, $guzzleClient));
$page = new Page(self::PAGE_ID);

$page->getSelf();
$this->assertEquals(self::PAGE_ID, $page->{PageFields::ID});