facebook-php-sdk

Facebook getUser() function returning user ID after logout

徘徊边缘 提交于 2019-11-30 03:38:20
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 cookie: $facebook->getUser(); For some reason, the getUser() function still returns the user's Facebook ID, even after they have logged out of Facebook on their website. Am I to detect the session first using another Function? On the official documentation example here , is the following excerpt from their comments: // Get User ID $user = $facebook->getUser(); //

Facebook PHP SDK 3.0 - How to get my page wall posts at any time?

痴心易碎 提交于 2019-11-30 00:22:28
问题 I have been trying to read the news feed from a page that I have using an app that I'm coding. Now I have had some issues trying to do this using the PHP SDK 3.0. I am able to get the page information, but this is something that is publicly available any way. My question is how do I get (read) the page wall posts? I'm assuming I have to grant permissions to my app to post to page, but how do I do this? currently this is the code that I have $appId = 'XXXXXXXXXXXXXXXXXX'; $secret =

Facebook publish stream directly using PHP

依然范特西╮ 提交于 2019-11-29 23:15:56
问题 I am trying to publish stream on my facebook WEBSITE wall page. so far I succeeded to publish stream via my APP page but I dont want via, I want to publish directly. as I said before, I want to publish on my facebook WEBSITE wall page, not on the app wall page. I couldnt find anything useful... also I want to publish with PHP if thats possible.. if it is not possible than I guess I will have to use js. anyway how can I do that? 回答1: this is how I do it with PHP : //Note that you will need to

passing custom parameters to facebook fan page tab

安稳与你 提交于 2019-11-29 20:20:12
I'm unable to get custom parameters send to my facebook fan page tab. I'm using php and is passing like this: http://www.facebook.com/pages/ {page-name}/?sk=APP_ID&pass=1 but I'm unable to read the parameter pass Sreejith Facebook passes in your data as part of the signed_Request data. Here is how you would retrieve it using PHP: <?php require 'facebook.php'; $app_id = "YOUR APP ID HERE"; $app_secret = "YOUR SECRET KEY HERE"; $facebook = new Facebook(array( 'appId' => $app_id, 'secret' => $app_secret, 'cookie' => true )); // THE MAGIC SAUCE $signed_request = $facebook->getSignedRequest();

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

我的未来我决定 提交于 2019-11-29 18:38:41
问题 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: ?sate=9b1772342342...&code=9b177asd2l..&base_domain=9b1772.3423# = I can't release the site.. Please help! 回答1: I think this is a Facebook bug, I just finished figuring it out myself. You need to alter the Base_Facebook class, and add in a new query param to strip out. The base_domain

Facebook PHP API post to wall falls under “Recent Posts by Others”

偶尔善良 提交于 2019-11-29 18:03:37
问题 I want to post a message to the wall of a Facebook Page. I am the admin of the app and the page used in this code, I already gave permissions needed for my app to be able to post on my page, it works when I use only the field "message", like this: $message = array( 'message' => "Test2",<br> ); $result = $fb->api('/411895472189524/feed','POST',$message); The code above posts to my page wall and the post is made "from" the page itself, just like if I would do it manually from facebook. This is

Facebook PHP SDK - Login helper returns error

醉酒当歌 提交于 2019-11-29 17:44:19
i have created a app witch are using facebook as a login opportunity. My APP worked public fine 1 day ago, but today it started getting this error when my users are logging in: Graph returned an error: Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings. My code looks like this: <?php require 'vendor/autoload.php'; if(!session_id()) { session_start(); } // Setting a local setting $fb = new Facebook\Facebook([ 'app_id' => '****', 'app_secret' => '****',

Facebook Authentication in IE not woking

核能气质少年 提交于 2019-11-29 16:57:17
Im making a facebook canvas app. To get the users info im using the PHP SDK: <? $app_id = ""; $secret=""; $canvas_page = ""; $auth_url = ""; $facebook = new Facebook(array( 'appId' => '', 'secret' => '', )); // Get User ID $user = $facebook->getUser(); if ($user) { try { // Proceed knowing you have a logged in user who's authenticated. $user_profile = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); $user = null; } } // Login or logout url will be needed depending on current user state. if ($user) { $logoutUrl = $facebook->getLogoutUrl(); } else { $loginUrl = $facebook

CakePHP FacebookSession class not found issue

六眼飞鱼酱① 提交于 2019-11-29 16:47:03
I'm trying use Facebook lib v4 to create a simple Facebook login. I'm following Facebook guide and I'm stucked at begnning, CakePHP is not finding FacebookSession class, follow below the facts: FacebookSession class path: App/Lib/Facebook/src/Facebook Use in Controller: app::uses('FacebookSession', 'Facebook/src/Facebook'); I think the Issue is in this specific Facebook Lib because I'm using WideImage class and I'm applying the same logic to use the Class and is working Perfectly. For the record I'm using PHP 5.4 ndm Custom paths/packages need to be registered First of all that's not how App:

FQL Error 102 Requires user session on a repeated query

一世执手 提交于 2019-11-29 15:46:04
问题 I have a fully functional FQL query, but when it is triggered for the second time i get an error code 102: Requires user session On my app i have an Autocomplete Search for Friends. I am using jquery ui autocomplete with a dynamic source using AJAX. This is my PHP Function: function fb_buscarAmigosAutocomplete($term='',$app_user=false){ $facebook = new Facebook(array( 'appId' => APP_ID, 'secret'=> APP_SECRET )); $term=trim(strtolower($term)); //Buscar usuarios try{ $fql = " SELECT uid,name