facebook-php-sdk

Parsing Facebook PHP API Response - Remastered / Recycled 05/02/2015

倖福魔咒の 提交于 2019-12-02 23:29:48
问题 My Array; { "bio": "Testing Facebook Bio -> Stupidly forgot to set whilst trying to fetch this information testing my latest Facebook App!", "movies": { "data": [ { "name": "Night At The Museum", "id": "251922028320619" }, { "name": "Little Nicky", "id": "112378985439799" }, { "genre": "Action / Adventure / Comedy / Family / Sci-Fi", "name": "Back to the Future Trilogy", "id": "141545972523915" }, { "genre": "Stupid", "name": "Jackass", "id": "21295715752" }, { "genre": "Comedy", "name": "Mrs

Facebook Ads API to update “Customer List: Value-based”

ε祈祈猫儿з 提交于 2019-12-02 23:23:53
问题 I created a Custom Audience of type "Customer List: Value-based". I then used that to create a "value-based Lookalike Audience". The documentation for "value-based Lookalike Audience" is here. But what I want to know is: How can I use the PHP SDK to update my Custom Audience of type "Customer List: Value-based" via the API? (Then, the changes will flow through to the lookalike audience, which is what I use in my ads targeting.) I cannot find documentation. P.S. Ding Zhang of Facebook

Retrieve Lead Ads Facebook API

无人久伴 提交于 2019-12-02 20:22:34
问题 I have problems retrieving Lead Ads. I have the Ad-ID and the Page-ID. I haven't created them, but was added as a developer. I was trying to use the PHP SDK and this https://developers.facebook.com/docs/marketing-api/guides/lead-ads/v2.9 Nothing is working. I cannot find a nice tutorial about that. I just want to retrieve the leading Ads! Anyone? 回答1: Assuming you have already installed FB API SDK and configured your FB app, you can use this to get all results from all LeadAds of your $page

Post to facebook fan page as a user

烂漫一生 提交于 2019-12-02 19:45:54
问题 Can anyone tell me how to do this using php sdk. I have using this code. This code was suppose to post to user's timeline as well as the fan page. The person who is logged in would be the one who is doing the post. So on the fan page this would have appeared under recent activity. However, now the code has stopped working saying that the user has not authorised the app. I do not understand why this could be happening. include("../php-sdk/facebook.php"); /*START FACEBOOK lOGIN*/ $facebook =

In Facebook Graph API, what are the API calls to get a user's email address and gender?

☆樱花仙子☆ 提交于 2019-12-02 19:33:01
问题 I'm using the Graph API and the Facebook SDK for PHP with the help of this link: https://developers.facebook.com/docs/php/howto/profilewithgraphapi/4.0.0. This is the code: use Facebook\FacebookRequest; use Facebook\GraphUser; use Facebook\FacebookRequestException; if($session) { try { $user_profile = (new FacebookRequest( $session, 'GET', '/me' ))->execute()->getGraphObject(GraphUser::className()); echo "Name: " . $user_profile->getName(); } catch(FacebookRequestException $e) { echo

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

。_饼干妹妹 提交于 2019-12-02 17:48:07
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 the new SDK this function doesnt exist anymore. I think I need to login using: setPersistentData($key, $value) but this function is protected and I dont know what 'code' is? Do I need this to log the user in or not? And what's going on with 'sig'? Don't I need this anymore? Hope someone already figured this out because the documentation really doesn't help! With

Get latest Facebook posts of page with PHP SDK

我的梦境 提交于 2019-12-02 17:45:35
The following code is inside a file called facebook_posts.php which I call from my index file like so: <?php require_once("http://www.example.com/design/php/facebook_posts.php"); ?> . However, where this code is put, there is no response. So neither success, nor the catch errors return an error (as I see it). I tried absolute URLs, but that didn't work either. (I hid the api and page information.) Apparently the content that follows the require_once (footer and scripts) aren't loaded. Something seems to go wrong when including the SDK. I'm not using composer, do I need to require the Facebook\

Facebook login is suddenly not working anymore?

青春壹個敷衍的年華 提交于 2019-12-02 17:40:32
问题 We have a custom facebook login which I wrote for our website sourcecodedb.com and without any changes to our code the facebook login stopped working around april 15th 2012, our twitter api also got very slow but thats another problem. This is the page users are sent to when they click the login button. <?php require_once('fbsdk/facebook.php'); $facebook = new Facebook(array( 'appId' => 'xxx', 'secret' => 'xxx', )); $params = array('scope' => 'read_stream, email', 'redirect_uri' => 'http:/

How to keep Twitter API session alive after logging through Facebook API?

怎甘沉沦 提交于 2019-12-02 17:09:33
问题 The two different API code for Facebook, Google+ and Twitter is located in three respective different folders: "facebook" folder for the Facebook API, "twitter" folder for Twitter and "google_plus". I'm trying to allow people to log on through Twitter and access the application, and give them the option to also log on through Facebook after logging on through Twitter and keep the twitter-based data after they logged through Facebook. I would basically like them to be able to view both their

Facebook App Error forbidden by X-Frame-Options

ぃ、小莉子 提交于 2019-12-02 14:31:25
问题 I am building a facebook app currently it is in sandbox mode. My code :- index.php <?php ob_start(); @session_start(); require 'facebook.php'; include_once('config.php'); $facebook = new Facebook(array( 'appId' => APP_ID, 'secret' => SECRET_KEY, )); $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; } if (!empty($user_profile )