3

I am working on Real Time Updates for lead api of facebook and when I am trying to get the details of lead by leadgeneration it throws me error PHP Fatal error: Class 'Facebook\\FacebookSession' not found. I have downloaded the facebook php sdk facebook-php-sdk-v4-5.0.0 through composer and file structure is - vendor\facebook\php-sdk-v4\src\Facebook and the code is -

<?php

define('FACEBOOK_SDK_V4_SRC_DIR',__DIR__.'/vendor/facebook/php-sdk-v4/src/Facebook');

require_once __DIR__ . '/vendor/autoload.php';

use Facebook\FacebookRequest;
use Facebook\FacebookSession;
echo FACEBOOK_SDK_V4_SRC_DIR;
FacebookSession::setDefaultApplication('APP_ID', 'SECRET_TOKEN');
// Note that the page access token provided must have
// the read_page_mailboxes permission.
$session = new FacebookSession('ACCESS_TOKEN');

I had also refer the previeous question asked on stackoverflow - Error: Class 'Facebook\FacebookSession' not found with the facebook PHP SDK but it does not help me.

Any suggestion what I am doing wrong here ? Thanks in advance.

Also is there any files called FacebookSession.php in SDK ? As in my folder is is not present.

Community
  • 1
  • 1
Rakesh Shetty
  • 4,548
  • 7
  • 40
  • 79

0 Answers0