facebook-php-sdk

How to retrieve facebook user's friends albums information with facebook php sdk

╄→гoц情女王★ 提交于 2019-12-13 20:45:33
问题 Im kind of new in facebook development, so be patient with me :) I'm creating an app that manage the photo albums user. One of the features i'm developing needs to access the friends photos. I mean, the photos that my app user can see of his friends. How can retrieve thats albums and photos information? I have user_photos and friends_photos permission. Any sugestion? Thanks in advance!! Sorry for my lame english. Is not my native language. Sebastian 回答1: You need to make an API call, for this

Facebook PHP SDK Long-lived access token expires after refresh site

时光总嘲笑我的痴心妄想 提交于 2019-12-13 20:12:01
问题 I'm using Facebook SDK v5 for PHP and I'm trying to get long-lived USER access token. I'm getting it, makes long-lived once and save to my database, then I go to another page where I use it to get accesstoken to Facebook PAGE. To this point everything goes fine. Then I refresh my page, and User AccessToken has ["expiry at"] set to 1970-01-01. I have no idea what is happening, because I don't rewrite this access token in database. And the most wired thing is that, this token works with

How to use facebook api version 1.0 instead of 2.0

本小妞迷上赌 提交于 2019-12-13 18:37:33
问题 I want to use facebook api 1.0. Is it possible to mention its version directly in the code, like in facebook->api() call? or give me a download link for it. I searched for its download link but i couldnt find it. I want to use v1.0 because there is something which v2.0 is not supporting, like read_requests permissions to get user's friend requests or if there is way to get friend requests in v2.0 please mention it in your answer. 回答1: i created my app some 12 days ago. As the Platform

Sending “App Requests” to multiple recipients using Graph API

只谈情不闲聊 提交于 2019-12-13 15:21:51
问题 I'm using Facebook's new Frictionless Requests , which allow you to send user-generated request to multiple pre-selected friends using the 'to' property in the FB.ui() method: Fb.ui({ method: 'apprequests', message: '...', to: 'uid1,uid2,uid3,...' }, cb); I'm wondering how I can similarly send an app-generated request to multiple recipients in a single API call. The Facebook Doc shows the following example for sending an app-generated request to a single recipient via Graph API: <?php $app_id

facebook application php post to friends wall

女生的网名这么多〃 提交于 2019-12-13 09:37:28
问题 I have a script that succesfully posts to my friend wall link and message, but when i turn on loop like this: for ($i = $from; $i <= $to; $i++) { $sendTo = $userid[$i]; echo '<p>sending user '.$i.'</p>'; if($result = $facebook->api("/$sendTo/feed/",'post', $attachment)) { echo '<p>sended user '.$i.'</p>'; } else { echo 'Oops something went wrong'; }} it only posts 4 or 5 messages and then break. I suppos the problem is at facebook does not allowing many message to send in short time. How can

get application user's info - Facebook-GRAPH API-PHP SDK

扶醉桌前 提交于 2019-12-13 09:28:11
问题 i need to dump some info of the application user's i am using this code ! $fbme = $facebook->api('/me'); $str = $fbme['name'].' '.$fbme['sex'].' '.$fbme['hometown_location'].' '.$fbme['profile_url'].'\r\n'; $fp = fopen("data.txt", "w"); fwrite($fp, $str); fclose($fp); but this only shows the name, nothing else ! why ? 回答1: You're making up property names. It's not sex, it's gender. And so on. Read: http://developers.facebook.com/docs/reference/api/user/ 回答2: $friends = $facebook->api('me

Some of the aliases you requested do not exist: {$a_data->id}

这一生的挚爱 提交于 2019-12-13 09:14:11
问题 While I am developing a facebook application, the following error is coming which I am unable to correct: Some of the aliases you requested do not exist: {$a_data->id} Here is my code: $request = new FacebookRequest($session, 'GET', '/me/albums?access_token='.$accessToken.'&limit=500'); $response = $request->execute(); $getUserAlbums = $response->getGraphObject(); $userAlbums = $getUserAlbums->asArray(); # logic for finding most liked user album foreach($userAlbums['data'] as $a_data){ var

login with facebook with database

我与影子孤独终老i 提交于 2019-12-13 09:02:58
问题 in my localhost site i am using login with facebook feature and it's working fine but now i want to store user details to my database so, i put some code in facebook SDK file fb-callback.php like... <?php session_start(); require_once 'facebook-php-sdk-v4/src/Facebook/autoload.php'; $fb = new Facebook\Facebook([ 'app_id' => 'app_id', // Replace {app-id} with your app id 'app_secret' => 'app_secret', 'default_graph_version' => 'v2.5', ]); $helper = $fb->getRedirectLoginHelper(); try {

trying to use use facebook-php-sdk library to retrive facebook posts

ぐ巨炮叔叔 提交于 2019-12-13 08:57:40
问题 I am trying to pull facebook posts onto my site so that I can save and display it in my own format. I am trying to use the facebook-php-sdk library, found on the Facebook Developer pages. I used the following code after I required the library: $facebook = new Facebook(array( 'appId' => 'MY APP ID', 'secret' => 'MY APP SECRET', )); // Get User ID $user = $facebook->getUser(); print_r($facebook); print_r($user); The print_r into $facebook showed me a full facebook object, so I know its being

Facebook app access token posts are only visible to me and not my friends or followers?

微笑、不失礼 提交于 2019-12-13 05:39:09
问题 When I post to facebook using my App Access token, it is successfully posted and returns the post id. But I am the only person who can see the post on my wall, no body else can see the post. Please help me !? 回答1: In fact I just needed to go to Status & Review tab and allow make my app visible to general public. 来源: https://stackoverflow.com/questions/23088660/facebook-app-access-token-posts-are-only-visible-to-me-and-not-my-friends-or-fol