Questions tagged [facebook-php-sdk]

The Facebook PHP-SDK provides Facebook Platform support to your PHP - based web apps.

This library helps you add Facebook Login and Graph API support (targeted posting, ad management, photo upload etc.) to your Website.

Documentation facebook-php-sdk

3679 questions
19
votes
1 answer

CURL Get Request with a parameter that contains a GET url

I'm trying to make a cURL GET to scrape a Facebook Graph object: GET https://graph.facebook.com/?id=**OBJECT_URL**&scrape=true&method=post In my case, OBJECT_URL contains GET parameters: https://www.example.com/og.php?a=b&c=d For that reason I…
Maxim Laco
  • 545
  • 2
  • 7
  • 17
19
votes
5 answers

How do I can post a multiple photos via Facebook API

Now I posting a single photo to wall like this: $response = $facebook->api("/$group_id/photos", "POST", array( 'access_token=' => $access_token, 'message' => 'This is a test message', 'url' =>…
Red October
  • 689
  • 2
  • 12
  • 31
18
votes
1 answer

How to integrate Facebook PHP SDK with Laravel 5.4?

I was searching for an easy way to integrate Facebook PHP SDK with Laravel 5.4. Essentially, I wanted to make it available as a service within my Laravel app. Of course there is SammyK/LaravelFacebookSdk on github. But for some reason I didn't…
Adam Ranganathan
  • 1,691
  • 1
  • 17
  • 25
17
votes
3 answers

How do I get the App Access Token via the Facebook PHP SDK?

I'm trying to retrieve the app access token of my app in order to post notifications, but for some reason, it doesn't work. Here's the code: $AppParams = array( 'client_id' => 'myclientid', '&client_secret' => 'myclientsecret', …
15
votes
5 answers

Facebook getUser() function returning user ID after logout

I'm developing using the Facebook PHP SDK. I wanted to make it so that when the user logs out of Facebook, they will automatically be logged out of my website too. I am using the following code to detect the session, using the session…
Luke
  • 22,826
  • 31
  • 110
  • 193
15
votes
8 answers

Why is getSessionFromRedirect() return a NULL?

I have the following code which redirects the user to log into facebook and tries to retrieve the session but the session is NULL:
SBel
  • 3,315
  • 6
  • 29
  • 47
15
votes
11 answers

Fatal error: Uncaught CurlException: 7: couldn't connect to host thrown in ....src/base_facebook.php on line 887

I'm trying to develop a sample facebook php login example following the example here I've hosted my app here, but I'm getting the error message in the question whenever I try to access the link. Here's the code segment that throws the error try { …
seeker
  • 6,841
  • 24
  • 64
  • 100
14
votes
4 answers

Facebook login in laravel 5.2 can't hold the session after redirect

I am using Facebook PHP SDK to log my user. I created a guard called login for this Here is my config file of auth.php 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver'…
sunny kashyap
  • 2,193
  • 2
  • 19
  • 29
13
votes
3 answers

What's method for checking user fan of a page in GRAPH API?

In graph api, Pages.isFan method not working, what's method for checking user fan of a page in graph api? Thanks.
John
  • 169
  • 1
  • 3
  • 9
13
votes
23 answers

Facebook PHP SDK 5 :: API 2.4 :: Cross-site request forgery validation failed. Required param "state" missing

I did a very simple PHP script, just to try to login via Facebook and get an accessToken. But when I try the following code, I get an Exception from the SDK : « Cross-site request forgery validation failed. Required param "state" missing. ». Here is…
13
votes
3 answers

Fetching third party posts from the Facebook Graph API

I am in the process of putting together a Facebook tab application for a client that fetches and displays posts from a Facebook page. The application also offers the ability to add new posts to the page and comment on existing posts. This is…
Daniel Greaves
  • 987
  • 5
  • 24
12
votes
2 answers

How to extract Facebook Access token Expiration Info

is there ay way to get the Expiration date of the access token, I need this so I can refresh my session, also I want this way so I can avoid to look up on facebook user data when being fetch via PHP cURL. also on this…
12
votes
12 answers

Getting Facebooks' Cover Photo via PHP SDK & Graph API

I'd like to know if there is a simple way of retrieving the Cover photo from a user in my application, via the Facebook php sdk. I managed to retrieve the cover photo id of the album of the cover photo album, but my solution only works partially.…
funerr
  • 7,212
  • 14
  • 81
  • 129
12
votes
3 answers

Facebook OAuth Error: Application request limit reached

I'm trying to get facebook's example page working (again) which you can find here. I'm getting the following error: Fatal error: Uncaught OAuthException: (#4) Application request limit reached thrown in C:\wamp\www\base_facebook.php on line…
tnw
  • 13,521
  • 15
  • 70
  • 111
12
votes
1 answer

Maximum limit fetching facebook pages with Graph API

What is the maximum limit for fetching the facebook pages from an account? Let's suppose if a facebook account has more than 200 pages to administer. If I try to retrieve facebook pages of that account using '/me/accounts' edge. Then I get data as…
user3020531