facebook-php-sdk

Sorry, something went wrong after cancel application connexion on SDK 3.0

最后都变了- 提交于 2019-12-11 05:01:35
问题 I'm using the new PHP SDK 3.0 and I use the new getLoginUrl() function with the following parameters. $paramsLogin = array( 'scope' => PERMISSIONS, 'redirect_uri' => REDIRECT_URI ); If the user clicks "cancel" on the application permissions popup, I redirect the user on an error page which contains a message explaining that he has to accept the permissions in order to participate to the contest and a new login button. But when i click on the login button again, facebook displays the following

Send FB user a notification via App

坚强是说给别人听的谎言 提交于 2019-12-11 05:00:02
问题 I'm getting an App access token via the Facebook API. $app_id = "ID"; $app_secret = "SECRET"; $token_url = "https://graph.facebook.com/oauth/access_token?client_id=".$app_id."&client_secret=".$app_secret."&grant_type=client_credentials"; $app_token = file_get_contents($token_url); When $app_token is echoed, the following is displayed access_token=xxxxxxxxxxxxxxxxxxxxxxxx // access token x'ed out for security. The "ID" is equal to my application ID (which I'm not silly enough to write). There

Getting warning while creating a page access token with 'manage_pages' permission

冷暖自知 提交于 2019-12-11 03:45:28
问题 When I try to get a page_access token with 'manage_pages' permission, i get following warning The following permissions have not been approved for use: manage_pages. If you make your app public, they will not be shown to people using your app. Submit them for review or learn more. I am the admin of this facebook page. Trying to retrieve My Fanpage's reviews in my website, through php sdk v4. 回答1: From v2.0 onwards, the permissions other than public_profile , email and the user_friends need to

FQL: query for event table returns venue.name instead of venue.id

ぃ、小莉子 提交于 2019-12-11 03:28:39
问题 When making a query to get event details I seem to get venue.name instead of venue.id in the result set. Has there been an unannounced change in the table structure or am I doing something wrong. The Graph API Explorer gives the venue.id yet when using FQL through PHP SDK in my own web site it's the venue.name I get. Heres the code: $fql='{ "event_info": "SELECT name,description, pic_small,pic_big, eid,venue,location FROM event WHERE eid ='.$_GET['id'].'", "event_venue":"SELECT name, username

Delete Facebook Session After Login with PHP SDK

强颜欢笑 提交于 2019-12-11 03:23:07
问题 I am using the facebook php sdk for a one-click login and registration. After a user is authenticated I am adding the user to my own db and session and then I want to immediately delete the facebook session. I cant find any documentation on how to delete the facebook session without deleting my own session. Thanks 回答1: This seems to work: if (isset($_SESSION['fb_' . FB_APP_ID . '_code'])) { unset ($_SESSION['fb_' . FB_APP_ID . '_code']); } if (isset($_SESSION['fb_' . FB_APP_ID . '_access

PHP-SDK Facebook auth keeps redirecting

我与影子孤独终老i 提交于 2019-12-11 00:43:37
问题 I am trying to integrate Facebook into a web app that I am working on. I got an api key and secret key from Facebook, and have set the Site Url to http://www.mysite.com/something/app/ The following code is used from http://www.mysite.com/something/app/signup/xxxx/ to detect whether the user is connected or not: $facebook = new Facebook(array( 'appId' => FB_APIKEY, 'secret' => FB_SECRETKEY, 'cookie' => true )); $session = $facebook->getUser(); if($session) { # Active session, let's try getting

Code shown as text output

限于喜欢 提交于 2019-12-11 00:25:41
问题 I'm a newbie to Facebook app development. It almost works when the page liked.php is shown (it's shown when a user liked the site), the PHP code is displayed as text output. my liked.php code: deleted for privacy reasons ?> Here's the output(it's shown as blank text): I simply don't know why. Even the error_reporting(E_ALL) ; doesn't show anything. Simply blank text output. I use the newest facebook php sdk. 回答1: I guess the problem is not in the code but in the configuration of your server.

Display [Image][url] from Graph API

落爺英雄遲暮 提交于 2019-12-10 22:14:40
问题 Building an Facebook Video application. Users can Favorite videos by using in app og.like. I use $response = $facebook->api( 'me/og.likes', 'GET' and i will get "data": { "object": { "id": "1399918593560042", "url": "http://some_url.com", "type": "video.tv_show", "title": "the_video_title" } To get url i use. $response = $facebook->api( 'me/og.likes?app_id_filter=381977341837631', 'GET' ); foreach ( $response['data'] as $data ); $Object = $data['data']['object']; Then <li class="program"><a

Graph returned an error: Invalid appsecret_proof provided in the API argument

[亡魂溺海] 提交于 2019-12-10 20:04:51
问题 i am using facebook PHP sdk (v4) to fetch user information, after installing SDK, i add the code $fb = new Facebook\Facebook([ 'app_id' => 'my app id', 'app_secret' => 'my app secret', 'default_graph_version' => 'v2.5', ]); try { // Returns a `Facebook\FacebookResponse` object $access_token= //copied from my https://developers.facebook.com/tools/explorer/ $response = $fb->get('/me?fields=id,name', '$access_token'); } catch(Facebook\Exceptions\FacebookResponseException $e) { echo 'Graph

facebook extended permissions

99封情书 提交于 2019-12-10 19:11:48
问题 UPDATE 2: OK, got it "kind of" working by changing: $loginUrl = $facebook->getLoginUrl(array( 'canvas' => 1, 'fbconnect' => 0, 'req_perms' => 'publish_stream', 'next' => 'http://'.$_SERVER['SERVER_NAME'].'/success.php', 'cancel_url' => 'http://'.$_SERVER['SERVER_NAME'].'/cancel.php' )); to this: $loginUrl = $facebook->getLoginUrl(array( 'canvas' => 1, 'fbconnect' => 0, 'req_perms' => 'publish_stream', 'next' => 'http://'.$_SERVER['SERVER_NAME'].'/success.php', 'cancel_url' => 'http://'.$