facebook-php-sdk

How to login in website using facebook id

我们两清 提交于 2019-12-03 19:09:20
问题 I have made a website on which a user has to log in using a username and password. I have seen these in so many website, we can connect through facebook account. And I want to add the same to my web site. How is it possible,using php sdk or the javascript sdk? 回答1: The team at Facebook has spent considerable time documenting this, I would suggest you start there: http://developers.facebook.com/docs/guides/web#login http://developers.facebook.com/docs/authentication/ 回答2: If possible, I would

FacebookSDKException: Session not active, could not store state

☆樱花仙子☆ 提交于 2019-12-03 17:38:59
问题 I don't understand why I'm getting this exceptions: Session not active, could not store state. The code is: <?php require 'vendor/autoload.php'; use Facebook\FacebookSession; use Facebook\FacebookRedirectLoginHelper; FacebookSession::setDefaultApplication('foo', 'baz'); $helper = new FacebookRedirectLoginHelper('bar'); $loginUrl = $helper->getLoginUrl(); ?> Please help. 回答1: You need to start a session using session_start() for the Facebook SDK to work correctly. Please add this to your code

Facebook Graph API v3.1 Access Token Permission Limitations For Developers

橙三吉。 提交于 2019-12-03 16:45:50
As you know that Facebook upgraded it API to V3.1 and now killing old APIs and Apps slowly so we have to migrate on there new API where they took some hard decision that is good on SPAM site but hard for developers too. Reminder: Graph API v2.7 will be deprecated on Oct 05, 2018. Please use the API Upgrade Tool to understand how this might impact your app. For more details see the changelog Now I created a new FB app with some settings as shown in the below screenshots to Post On My Own Pages not Profile but got errors that is mentioned below too. And then I used the below code to post on my

Symfony3 Facebook Login - redirect_uri URL gets converted to relative

青春壹個敷衍的年華 提交于 2019-12-03 16:25:31
I am trying to implement facebook login for a web-app. Here is the FacebookConnect.php <?php namespace Vendor\GiftBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGenerator; class FacebookConnectController extends Controller { /** * @Route("/connect/facebook", name="connect_facebook") */ public function

Incorporating facebook login, using facebook php-sdk (v.3.0.0), with sessions and cookies

。_饼干妹妹 提交于 2019-12-03 15:49:12
I am new to PHP, and have had a very difficult time understanding the facebook login system. I have downloaded the three src/ files from github (https://github.com/facebook/php-sdk/). I tried using the example.php file to get me started. However, I am not sure what to do with it. For those who are unfamiliar with the file, here is a copy of example.php, with some of the styling removed: require '../src/facebook.php'; $facebook = new Facebook(array( 'appId' => '...', 'secret' => '...', )); $user = $facebook->getUser(); if ($user) { try { $user_profile = $facebook->api('/me'); } catch

How to get user profile info using access token in php-sdk

自闭症网瘾萝莉.ら 提交于 2019-12-03 14:15:46
问题 I want to get user profile using access token that i have already generated , and if the access token is invalid it shoud display error. anyone can help to do this ? i want php code to handle this. i am waiting.... 回答1: Since you already have the access token , the simplest and clean way would be- $user_details = "https://graph.facebook.com/me?access_token=" .$access_token; $response = file_get_contents($user_details); $response = json_decode($response); print_r($response); 回答2: First check

Why is my test application in an endless redirect loop?

大憨熊 提交于 2019-12-03 14:04:30
问题 I am using the PHP SDK Version 3.1.1 in order to make a simple call to the Graph API. I am running it locally at http://local.fb-sandbox. The facebook application settings have the site URL set to http://local.fb-sandbox/. I am redirected to the facebook login page and then to the page requesting my permission when I go to http://local.fb-sandbox but the application then goes into a redirect loop between a URL like: http://local.fb-sandbox/?state=e9c091bb61afe08139af4e3b153a1e9e&code

Match facebook campaign objective with insights actions types

大城市里の小女人 提交于 2019-12-03 12:34:56
问题 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 and actions do not match. For example, there is a PAGE_LIKES objective and a like action. In the facebook power manager there is a "Results" column which gives, for each campaign, the user actions count that match the campaign objective ( 992

Maximum limit fetching facebook pages with Graph API

余生长醉 提交于 2019-12-03 11:43:57
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 well as paging (containing cursors and next , previous page links). What I want to know is If I can set a limit while fetching the facebook pages like '/me/accounts?limit=200' and get all the 200 facebook pages the account has?? I have searched the documentation But there is no clear explanation as for this rate limit . luschn If you mean the API

Weird url appended “#_=_” [duplicate]

巧了我就是萌 提交于 2019-12-03 10:31:53
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Play Framework appending #= to redirect after Facebook auth via OAuth2? Has anyone else seen this happen? I am building a Facebook canvas app using the Facebook PHP SDK, and some Javascript. Now when I take the user through the OAuth authentication flow, I have noticed that the URL in the browser automatically gets appended with this "#_=_" , so my URL starts looking like this: http://apps.facebook.com