facebook-php-sdk

Not receiving signed_request in Facebook iframe-app

一个人想着一个人 提交于 2019-12-11 09:18:07
问题 I have created a Page Tab Facebook App where I want to display different content depending on the user being a fan or not. (Also called fan gate, landing page or reveal page) For this I'm using the PHP SDK, in specific the following code: <?php require 'src/facebook.php'; $facebook = new Facebook(array( 'appId' => 'APP_ID', 'secret' => 'APP_SECRET', 'cookie' => true, )); ?> And in the content: <?php $signed_request = $_REQUEST["signed_request"]; list($encoded_sig, $payload) = explode('.',

unset $_SESSION not working

我们两清 提交于 2019-12-11 09:05:13
问题 Hi i made a code that connects with facebook and register the user, then it makes the user login , everything works very nice.. When they login i set $_SESSION['id'] My guess was, if this was unset the user will be logout from my site, and it wont be "autoreconnected".. Because previously it was like a loop, everytime i logout, it login again using the facebook connect even if the user havent clic again "login with facebook"... EDIT: I change a condition and know is not "looping" i CAN logout

Login With Facebook SDK PHP - User Must Click Login Twice

北战南征 提交于 2019-12-11 08:42:55
问题 I am trying use the PHP Facebook SDK to log users in with facebook. I have started off by using the example file provided in the .zip I downloaded from GitHub. When users click login they are taken to the authentication page. After the allow my app they are redirected back to the original page where it should print_r the user object. But it does not. Clicking login again skips the authentication page (as the user has already allowed the app) and then the object is printed. Anyhelp would be

Get a Facebook Page's public posts without an auth token

不打扰是莪最后的温柔 提交于 2019-12-11 07:46:53
问题 Is it possible (using the facebook graph API) to get the last 5 posts made by a Facebook Page? I would like to display this information in an Android app and want to avoid the overhead of using the Facebook Android SDK to avoid showing the " [App] would like to access your public profile and friend list " message because it's annoying and inaccurate. The following call works without an auth token for example: https://graph.facebook.com/nike But this one doesn't: https://graph.facebook.com

My facebook app make Infinite loop in sdk 3.1.1

被刻印的时光 ゝ 提交于 2019-12-11 07:25:51
问题 I have iframe facebook app but reload making infinite loop. Yesterday work fine, but not to day. I'm using javascript and php sdk 3.1.1 with this code: <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({ oauth: true, // turn oauth appId : 'myappId', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); FB.Canvas.setAutoGrow(); </script> FB

Facebook PHP Graph API not returning complete data

百般思念 提交于 2019-12-11 06:31:14
问题 I'm having an issue with Facebook's PHP SDK version 4.0. I'm simply trying to retrieve the insights/page_fans_city metric via the Graph API: $request = new FacebookRequest($session, 'GET', '/{my object}/insights/page_fans_city', array('period' => 'lifetime')); $response = $request->execute(); $client_graph_object = $response->getGraphObject(); print_r($client_graph_object); However, no data is returned: Facebook\GraphObject Object ( [backingData:protected] => Array ( [data] => Array ( )

How to get Facebook Share Count and Comment Count on Version 2.7

半城伤御伤魂 提交于 2019-12-11 06:19:59
问题 What is my Issued? Im not getting result/output, using my php code? (first issued) How to input my Access Token on my php code? (Second Issued) When i enter this URL from browser: https://graph.facebook.com/v2.1/?id=http://google.com Im getting result JSON: { "share": { "comment_count": 0, "share_count": 44100483 }, "og_object": { "id": "1485280808235339", "description": "Honoring our veterans #GoogleDoodle", "title": "Google", "type": "website", "updated_time": "2017-11-11T21:40:44+0000" },

Facebook PHP SDK: Getting (cropped) album cover

别说谁变了你拦得住时间么 提交于 2019-12-11 06:15:54
问题 I am using Facebook's PHP SDK and Graph API to obtain all albums from one user, and then display them to him so he can select which album he will browse. I want them displayed in a grid, just like Facebook does: every picture with the same width and height. The problem is that when I do: $fb->api('/' . $album_id . '/picture?access_token=' . $accessToken I get a version of the picture with the original dimensions, and not the way that Facebook shows them to you when you click on Photos, i.e. a

Facebook app - deep link for new app user

感情迁移 提交于 2019-12-11 05:46:08
问题 Short version I have a facebook iframe app as a page tab on a fan page. The app collects entries for a contest. It lists the entries and also has a page for showing a single entry. I want to be able to link to the single-entry page - I have this working using the app_data parameter, but only if the user has used the app before. This does not work for a new user who has to add the app (log in). Long version So far I've managed to get this partially working by linking to http://facebook.com

'getLogoutUrl' Does not work

两盒软妹~` 提交于 2019-12-11 05:21:36
问题 After I click on my logout button, it redirects me to: https://www.facebook.com/home.php. Why is it that when I return to my app domain, I can still see the logout button...? Here is my code: <?php //User login/logout buttons if($user) { echo '<a href="'.$facebook->getLogoutUrl(array('next' => 'myurl.com/facebook/')).'"><img src="src/logout-fb.png" alt="Facebook Logout Button" /></a>'; }else{ $params = array( scope => 'user_photos, publish_stream', redirect_uri => 'http://myurl.com/facebook/'