facebook-php-sdk

post to the fan page's wall as page from another PHP site

江枫思渺然 提交于 2019-12-04 17:01:19
I know that there are lot's of questons on this, but all seem to be needing a user to be logged in... I have been using code snippets from all possible tutorials, but none seem to work. Here is the scenario: I have a photo community running on PHP and I have a fan page on Facebook. When an image on the main site collects a certain amount of votes a function is triggered to post the image link to the Facebook wall. The link (post) is posted as a page and not as admin. Admin of course will not be online... Is this even possible to do these days? I have the latest PHP SDK and this is the function

Extending 60 days Facebook token

时光怂恿深爱的人放手 提交于 2019-12-04 16:01:23
I'm using Hybridauth to connect with Facebook. Everything works well at that point ;-) I get a token and when I check it at https://developers.facebook.com/tools/debug/ I see it has 2 months expiration. After some days, for example, 50 days, I see the token will expire in 10 days indeed. I try to extend with method documented (and described in other StackOverflow questions) with: https://graph.facebook.com/oauth/access_token? client_id=APP_ID& client_secret=APP_SECRET& grant_type=fb_exchange_token& fb_exchange_token=EXISTING_ACCESS_TOKEN Then I receive ANOTHER token, but if I check that new

Upload image to Facebook Wall / Feed via Graph API

99封情书 提交于 2019-12-04 15:52:56
I am trying to upload local images directly to a pages feed (i.e. "Wall Photos" album). This is the code that I think should work: <?php $facebook = new Facebook(array( 'appId' => $the_app_id, 'secret' => $this_app_secret, )); $facebook->setAccessToken($the_access_token); $facebook->setFileUploadSupport(true); $attachment = array( 'message' => $the_post_body, 'name' => $this_image_name, 'picture' => '@' . $the_absolute_path_to_image ); $result = $facebook->api('/me/feed, 'post', $attachment); But this code just yields a plain text wall post with the contents of "message" (i.e. picture field is

Getting friends list using facebook api's

只谈情不闲聊 提交于 2019-12-04 15:03:40
I have the following command which will allow me to post a message on the logged in users facebook wall: $facebook->api("/$uid/feed", "POST", array('message' => 'Hello! I\'m using the FB Graph API!')); i.e. using the url https://graph.facebook.com/<user id goes here>/feed But what command do I need to enter to get a list of the logged in users friends? The url I need to use is https://graph.facebook.com/me/friends , but I am not sure how to edit the below command to get the friends list: $facebook->api("/$uid/feed", "POST", array('message' => 'Hello! I\'m using the FB Graph API!')); am I

Facebook API: What is the Max length of 'message' on wall?

六月ゝ 毕业季﹏ 提交于 2019-12-04 14:17:34
I've scoured the Facebook documentation and I can't find the maximum length that can be passed to the Facebook API? If I pass a large value to the API using AJAX and using the PHP SDK, I'm getting neither and error or success message. (and no message on the wall). I'd like to restrict the user to the correct length to avoid any problems. Thanks for your assistance, Luke Eddy Chan If the message is a status update (that is, you're not including an attachment or an action link), it can contain up to 420 characters. Otherwise, if the post contains an attachment or action link, the message can

Facebook PHP SDK - will not logout properly

痴心易碎 提交于 2019-12-04 13:43:41
问题 I've been searching for hours for the solution to this problem but can't find one that works for me. When i click "Logout" on my site the user information is still visible and the logout button is still displayed. Here is the code: require 'facebook-php-sdk/src/facebook.php'; $facebook = new Facebook(array( 'appId' => 'xxxx', 'secret' => 'xxxx', )); // Get User ID $user = $facebook->getUser(); var_dump($user); if ($user) { try { // Proceed knowing you have a logged in user who's authenticated

Post an object of type Reference

笑着哭i 提交于 2019-12-04 13:00:33
I have had this problem for some time now and I have seen others have it as well. It has to deal with posting your custom objects that you create in Open Graph to post with your application. I am having this problem primarily on all platforms, but right now let's say I am using Android. If someone has accomplished this in C# or on IOS or even in PHP please post your answer. An Example: I have an object that posts a meal to Facebook. Let's say its properties are the following. mealName = "Lunch" mealType = "Vegetarian" mealLocation = "Somewheresville, OH" Now I have another object in my Open

Registering a new achievement: (#3502) Object at achievement URL is not of type game.achievement

倾然丶 夕夏残阳落幕 提交于 2019-12-04 12:12:20
I'm trying to add a new achievement for my game, when ever I try and test this on the Graph API Explorer, I get the following error: (#3502) Object at achievement URL is not of type game.achievement. I have followed this post(http://developers.facebook.com/blog/post/539/) to set up my achievement as such: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <meta property="og:type" content="game.achievement"/> <meta property="og:url" content="FULL URL OF ACH. PAGE"/> <meta property="og:title" content="TEST"/> <meta

Error Message: redirect_uri is not owned by the application

↘锁芯ラ 提交于 2019-12-04 11:51:51
::UPDATE:: LINKS DO NOT EXIST ANYMORE! Very strange indeed, this is definitely a bug! I did a test with app_id from another application and it worked. See for yourself: https://apps.megalopes.com/megabraziltv/test.php (app_id correct) https://apps.megalopes.com/megabraziltv/test2.php (app_id from another application) ---/--- I found several people with the same question and all the answers are equal: Site URL is not same as REQUEST_URI (Redirecting URL) My app setting are: Secure Page Tab URL: apps.megalopes.com/megabraziltv/... App Domain: megalopes.com code: <div id="fb-root"></div> <script

How could I determine which are the best friends of a Facebook application user?

家住魔仙堡 提交于 2019-12-04 11:33:32
I'm currently trying to create a Facebook application with the Facebook PHP SDK. I would like to retrieve which of the user's friends are his best friends, or the one he's most talking with. Do you know an algorithm or a tip to get them? Simply, look for markers of friendship, give each activity a weight, total up the "friend score", and appropriate by the age of the friendship (if you're looking for a "lifetime" score). You could look at different timeframes, such as "recent best friends", etc. I'm not phenomenally familiar with Facebook's Graph API, but if you could access the age of the