facebook-php-sdk

signedRequest doesn't return if user has liked the page

余生长醉 提交于 2019-12-02 13:23:13
问题 Hello I am developing an fb app using facebook sdk (php version) but for some reason the signedRequest doesn't return me the liked variable in order to determine if the user has liked the page. Below is the print_r of signedrequest : Array ( [id] => 395466473895310 [admin] => 1 ) any help appretiated thanks John 回答1: https://developers.facebook.com/docs/apps/changelog The 'liked' property will no longer be returned in the 'signed_request' object for Page Tab apps created after today. From

Post to facebook fan page as a user

瘦欲@ 提交于 2019-12-02 12:19:10
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 = new Facebook(array( 'appId' => Appid, 'secret' => Appsecret, 'cookie' => true )); $pageId = PageId; $user

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

戏子无情 提交于 2019-12-02 10:37:04
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 encouraged me to ask the question here since none of the people I reached at FB were willing to answer my

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

六月ゝ 毕业季﹏ 提交于 2019-12-02 10:33:38
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 Twitter and Facebook feeds and other data mixed together at the same time. I tried to implement sessions

Information about current user in facebook

有些话、适合烂在心里 提交于 2019-12-02 10:27:12
问题 I am trying to get facebook userid of the users currently logged in. I used this below piece of code ang got error "Uncaught OAuthException: An active access token must be used to query information about the current user" require '../src/facebook.php'; $facebook = new Facebook(array( 'appId' => '226668060741665', 'secret' => 'secret key', )); $rr=$facebook->getAccessToken(); $params = array( 'access_token' => $rr, 'installed' => 'true', 'permissions' => 'read_stream,publish_stream' ); $eded=

Facebook Graph API 2017 - Image uploaded to Timeline Photos instead of given Album (id)

南笙酒味 提交于 2019-12-02 10:14:52
My users can decide if they want to upload to the main timeline of their page or into one of the page albums. Everything works successfully, except the fact my images being uploaded to the Timeline Photos (default FB album) instead of the selected one. $timelinealbum is "me" if the timeline is selected, and it's the "%album_id%", if one of the albums selected. So the post url is "/me/photos" for timeline, and "/%album_id%/photos" for album. Debugged, working well. Photos still go to Timeline Photos... (No error message as the upload is successful.) Any idea? Thanks in advance! Here's the

Get facebook user if only logged in facebook php sdk

▼魔方 西西 提交于 2019-12-02 09:56:18
I want to get current loggedin facebook user in php sdk. Here is what i have tried: $facebook = new \Facebook(array( 'appId' => 'XXXXXXXXXXX', 'secret' => 'XXXXXXXXXXXXXXXXXXXXX', )); $user = $facebook->getUser(); var_dump($user); if ($user) { $logoutUrl = $facebook->getLogoutUrl(); echo $logoutUrl; } else { $loginUrl = $facebook->getLoginUrl(); echo $loginUrl; } When I load the page with above code, I get the loginUrl even though I am logged in facebook. Only when i load $loginUrl in the browser, I am able to get facebook user. How do I get the current user at first load of this page? I get

Getting Fatal Error Uncaught CurlException: 26: couldn't open file

柔情痞子 提交于 2019-12-02 07:57:12
I am trying to create a dynamic image of my friends using PHP's GD Library, and I need to upload this to my Friends Profile but I keep getting an Error Fatal error: Uncaught CurlException: 26: couldn't open file "" thrown in /home/p170r760/public_html/myfbapps/mysupporters/base_facebook.php on line 820 $image = imagecreatetruecolor(500, 500); $orange = imagecolorallocate($image, 0xFF, 0x8c, 0x00); $bg = imagecreatefromjpeg('app2_bg.jpg'); imagesettile($image, $bg); imagefilledrectangle($image, 0, 0, 499, 499, IMG_COLOR_TILED); $font_file = 'TURNBB__.TTF'; imagefttext($image, 20, 0, 105, 50,

Is it possible to get Facebook feed, likes and comments from a closed group that I own using the Facebook API + PHP

假如想象 提交于 2019-12-02 07:51:07
I want to build a web application that gets feed, likes and comments from a closed group that I own - using the Facebook API + PHP I saw that I can get information using this Graph API interface, started reading the facebook docs and got to a point that I start thinking that I cant actually do that: https://developers.facebook.com/docs/public_feed/ But still there is this: https://developers.facebook.com/docs/graph-api/reference/v2.2/group/feed and I just cant find the function that gets the group feed! So maybe I'm just not working right and I'm missing something. Although when running it on

Facebook get profile link after OAuth2 login

空扰寡人 提交于 2019-12-02 06:56:18
问题 I use OAuth2 login through the Facebook social network for users on the website. Is it still possible to get the certain user's Facebook profile URL after login(for example by accessToken ) or Facebook hides this information right now(after incidents with data leaks) and it is impossible? 回答1: It is, if the user grants permission. You need to ask for user_link permission on login, and then you can request the link field of the user object – that will return a URL that can be used in a browser