facebook-php-sdk

Facebook - Publish Checkins using PHP SDK/JavaScript SDK

拈花ヽ惹草 提交于 2019-12-01 12:09:49
I'm trying to publish checkin using Facebook Graph API. I've gone through Facebook API documentation (checkins) and also have the publish_checkins permission. However, my checkin is not getting published. May I know is there anything wrong or am I missing anything else? Thank you for your time :) fbmain.php $user = $facebook->getUser(); $access_token = $facebook->getAccessToken(); // Session based API call if ($user) { try { $me = $facebook->api('/me'); if($me) { $_SESSION['fbID'] = $me['id']; $uid = $me['id']; } } catch (FacebookApiException $e) { error_log($e); } } else { echo "<script type=

facebook->getUser() returning 0

纵然是瞬间 提交于 2019-12-01 11:41:55
问题 Whenever I try to login a prompt opens asking for the basic permissions, after that its being redirected to my redirect_uri with an URL =">http://localhost/demo/?code=AQDwzia3Wx1BktixF59jVHbm0ViGVJm8Xhb2tNZDyYreZh0KoSJhrSsJ8Aa2KX3gocwR0XNQjQz7ZlBh26_nBi-3iOMByhVO2cxwJ8maC4IHxBacfqXjzqIyBaZQbWKUUxPI6VBrqBgFXQasj7PEtmug7lt93dK4fmMC2A4i2dUYU-gSvzn0f0ZdB3eT_aSvgR1KoLCmQgLh3xix4H05QR6LCP9nLtQC4l9rMJW83kS0PNmWq0COZYvGfuX1R7519Fn3iXRB9F0MTsK1KQ_ulpK84PUCkuMu8et88Lln0ZwuzaPo0oERelkPWYnrrTKa-5w&state

facebook friends list getting

喜夏-厌秋 提交于 2019-12-01 10:32:42
I want to get a list of friends with php. I got the necessary permissions, but I can not get a list of friends. 'scope' => 'email, user_friends' $user_friends = $facebook->api('/me/friends'); result: ( [data] => Array ( ) [summary] => Array ( [total_count] => 46 ) ) The docs at https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids clearly states that the Graph API starting with v2.0 only returns the friends which also use the same app. In your case apparantly nobody of your friends actually uses that app, that's why the result array is empty. Please use the StackOverflow

Facebook - Publish Checkins using PHP SDK/JavaScript SDK

守給你的承諾、 提交于 2019-12-01 10:02:04
问题 I'm trying to publish checkin using Facebook Graph API. I've gone through Facebook API documentation (checkins) and also have the publish_checkins permission. However, my checkin is not getting published. May I know is there anything wrong or am I missing anything else? Thank you for your time :) fbmain.php $user = $facebook->getUser(); $access_token = $facebook->getAccessToken(); // Session based API call if ($user) { try { $me = $facebook->api('/me'); if($me) { $_SESSION['fbID'] = $me['id']

facebook->getUser() returns 0

核能气质少年 提交于 2019-12-01 09:07:31
I assume that this is because users have to grant some sort of access to my facebook application, for getUser to be available to me? Here is my code: <? require 'facebook.php'; ?> <?php $facebook = new Facebook(array( 'appId' => '[//fb app id]', 'secret' => '[//fb app secret]', 'cookie' => true )); $uid = $facebook->getUser(); echo $uid; ?> So I guess my question is, short of prompting the user to give permission to my app, is there any other sort of unique identifier that I can grab from a fb user to prevent them from submitting more than 1 entry to my app. I have user's add submissions, but

facebook friends list getting

余生长醉 提交于 2019-12-01 08:42:11
问题 I want to get a list of friends with php. I got the necessary permissions, but I can not get a list of friends. 'scope' => 'email, user_friends' $user_friends = $facebook->api('/me/friends'); result: ( [data] => Array ( ) [summary] => Array ( [total_count] => 46 ) ) 回答1: The docs at https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids clearly states that the Graph API starting with v2.0 only returns the friends which also use the same app. In your case apparantly nobody

How to make a user subscribe to an event in facebook using Graph API?

我的未来我决定 提交于 2019-12-01 08:14:46
问题 I would like to users when added to this website event registration also subscribe to the event in the facebook. The system is already asking for the "create_event" extra permission, I am not finding how to subscribe the user to a particular event after it logged in by graph api. How can I do that? Thanks, Joe 回答1: It's documented in the event object page: // RSVP to an Event curl -d "access_token=XXX" https://graph.facebook.com/EVENT_ID/{attending|declined} So you need to grant the rsvp

Reload fb:comments widget

橙三吉。 提交于 2019-12-01 08:01:12
I have a Facebook App that allows people to create "Posters". Every "Poster" can be commented on using fb:comments widget. User can switch between posters using AJAX. The problem is that after switching to next poster fb:comments widget is still pointing to previous URL. Is there a way to "reload" a widget for a new url? Ok, solved this by myself, leaving it here for reference. If you want to reload fb:comments widget it's as simple as that: // xid can only contain a-zA-Z0-9_%.- comments_html = '<fb:comments xid="' + encodeURIComponent(xid) + '"></fb:comments>'; // #comments is a div,

Facebook Graph API v2.1: getting user id and his posts

痞子三分冷 提交于 2019-12-01 07:41:21
Imagine the situation when I'm logged in facebook web application as userA. I know userB's nickname but he is not in my friendlist and I do not know his id. And, of course, he does not use my app. How can I get userB's id via a nickname? After that how can I get his wall posts? Are there any specific permissions? May be there are manual pages I've missed? In v1.0, the following was possible: http://graph.facebook.com/v1.0/{user-name} However, with v2.0 and v2.1, accessing users via IDs or Usernames not connected to your application is not possible. E.g., trying http://graph.facebook.com/v2.1/

Facebook OAuthException: (#1)

萝らか妹 提交于 2019-12-01 06:21:41
I have a few applications which upload image to user profile. A few hours ago all applications were working fine but now when uploading is requested, it gives this error Fatal error: Uncaught OAuthException: (#1) An unknown error occurred thrown in applications/fb-sdk/facebook.php on line 543 I'm using the following code to publish image. $FILE = "images/$image"; $args = array('message' => 'My msg '); $args['image'] = '@' . realpath($FILE); $data = $facebook->api('/'.$uid.'/photos', 'post', $args); Is it because of some policy change or some new feature? I have all the permissions like upload