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
9
votes
1 answer

How to log out user from facebook application, but maintain login from facebook

I have tried the PHP SDK (v.3.1.1), and the current Javascript SDK as suggested here : https://developers.facebook.com/docs/guides/web/ now when trying to log out I have tried both FB.logout() ( for js ) and $facebook->getLogoutUrl() ; as the…
Alias
  • 93
  • 1
  • 1
  • 4
9
votes
2 answers

Facebook graph API loop through paging

So I was working with this script to loop through the events from a given page. Suddenly I find it doesn't work anymore :( I have a feeling it could be a bug, because if you pick any page, view events with an access_token, you can't get any data…
Nathan Waters
  • 1,173
  • 4
  • 13
  • 23
9
votes
1 answer

suddenly, getUser became to return 0.(PHP 3.1.1 SDK)

Only 10 hours ago, if I call $facebook->getUser(), I can get the correct user_id, but now, it always returns 0. Of cource, I have not changed my code. There is another strange point. redirect_url contains:…
Taro Heisai
  • 93
  • 1
  • 5
9
votes
4 answers

Unknown algorithm. Expected HMAC-SHA256 spam in logs

I'm using facebook php sdk 3.1.1 and the current version of the facebook JS sdk. Our users are not reporting errors, but I'm seeing a ton of error log messages like this: Unknown algorithm. Expected HMAC-SHA256 I see from the source that the error…
9
votes
5 answers

PHP SDK 3.1.1 getUser() sometimes return 0

This is driving me crazy >=( $facebook->getUser() works well sometimes, but sometimes returns 0 Here is my code: require 'fbapi/facebook.php'; $facebook = new Facebook(array( 'appId' => 'xxx', 'secret' => 'xxxxx', )); $user =…
9
votes
3 answers

How to login with OFFLINE_ACCESS using the new Facebook PHP SDK 3.0.0?

with the old (2.x) SDK I used this to log someone with offline_access: $session = array ( 'uid' => $userdata['fb_uid'], 'sig' => $userdata['fb_sig'], 'access_token' => $userdata['fb_access_token'] ); $facebook->setSession($session); In…
martinyyyy
  • 1,652
  • 3
  • 21
  • 44
9
votes
2 answers

Facebook Graph API -> user/events returns empty array

Firstly, to explain the situation: my app has been approved by App Review for user_events (screenshot below) i am testing on the production app, with a real user account (testing with admin user returns false positives) calling {user_id}/ works and…
Haroldo
  • 36,607
  • 46
  • 127
  • 169
9
votes
2 answers

Error on Login using Facebook PHP SDK with Strict Mode Enabled

I got a notification from Facebook saying that they will invalidate calls from URIs not listed in the Valid OAuth redirect URIs this coming March 2018 and I think they are requiring us to Enable Strict Mode for Redirect URIs. Link about this can be…
pmichael16
  • 93
  • 1
  • 4
9
votes
1 answer

Is there a way to update FB Ad URL Parameters using Marketing API?

Is there a way to update ad URL Parameters with marketing api? It is possible from FB Ads Manager, but we have more than 200 different ads and we want to automatically update their URL params from api instead of doing it manually. I have checked FB…
9
votes
1 answer

Match facebook campaign objective with insights actions types

Facebook campaigns have an objective among those listed here (PAGE_LIKES, VIDEO_VIEWS, etc). Facebook insights list users actions among those listed here (like, video_view, etc, but some are missing, unlike for example). The problem is: objective…
9
votes
1 answer

Error (#200) The user hasn't authorized the application to perform this action

I would like to send messages to a Facebook page with PHP but I have this error (#200) The user hasn't authorized the application to perform this action. I'm the administrator of the Facebook page and the Facebook application. I think I have this…
user3065090
  • 113
  • 1
  • 1
  • 5
9
votes
1 answer

FacebookSDKException: Session not active, could not store state

I don't understand why I'm getting this exceptions: Session not active, could not store state. The code is:
SBel
  • 3,315
  • 6
  • 29
  • 47
9
votes
3 answers

When skipping Facebook authentication, shouldn't I get back an appropriate value to indicate the users decision?

In my app, I have the following code: $loginUrl = $facebook->getLoginUrl( array( 'scope' => 'publish_stream' ) ); header("Location: ".$loginUrl); which takes the user to facebook and asks them: '[oshirowanens app] would also like permission…
oshirowanen
  • 15,297
  • 82
  • 198
  • 350
9
votes
2 answers

Facebook Login Error: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request

I'm trying to follow the example to create a server side login to Facebook from here, but with no luck. In step 7, when I try to exchange the code with a token and store it in a session for later use, I always get this error : file_get_contents():…
Furunomoe
  • 1,344
  • 2
  • 16
  • 27
9
votes
5 answers

How to log out user using facebook SDK?

I am using a facebook log in for my web site using facebook php sdk. What I noticed is the logout link doesn't do anything. After I logout, the user can still navigate the site. Here is my code in facebook.php:
Mina Gabriel
  • 23,150
  • 26
  • 96
  • 124