Open damianlluch opened 4 years ago
You should include it in your controller
include_once APPPATH."libraries/vendor/facebook/graph-sdk/src/Facebook/autoload.php";
use Facebook\Facebook as FB;
use Facebook\Authentication\AccessToken;
use Facebook\Exceptions\FacebookResponseException as ResponseException;
use Facebook\Exceptions\FacebookSDKException as SDKException;
use Facebook\Helpers\FacebookJavaScriptHelper;
use Facebook\Helpers\FacebookRedirectLoginHelper;
Hi guys, thanks for your job.
I try integrated this project in my app with Laravel and I get this error:
TypeError: Argument 1 passed to Symfony\Component\HttpFoundation\Response::setContent() must be of the type string or null, object given, called in /home/damian/projects/marketing/vendor/laravel/framework/src/Illuminate/Http/Response.php on line 65 in file /home/damian/projects/marketing/vendor/symfony/http-foundation/Response.php on line 412
This is my code in Controller:
class FacebookController extends Controller { const FACEBOOK_ID = "XXXXXXXXX"; const FACEBOOK_SECRET = "XXXXXXXXX"; const FACEBOOK_TOKEN = "XXXXXXXXXXX...";
}
and this is my code in API:
Route::get('getPosts', 'FacebookController@getPosts');
thanks!