facebook-javascript-sdk

FB.ui feed not giving a callback

走远了吗. 提交于 2019-12-01 19:47:12
I am unable to get any feedback from my Facebook FB.UI() method. I am convinced that I am using it correctly, as the actual post does post to my wall, but the callback data is either missing or empty. I am using: FB.ui({ method: 'feed', name: 'asd', link: 'asd', picture: '', description: 'asd' }, function(response) { console.log(response); if(response.post_id) { $.post("ajax/wall.php",{wall : 1}); } else { } } ); I am not sure how this resolved itself, but it did :) I cleared my cache and changed my code to below and it worked (however I don't believe the change of code actually played any

Facebook SDK FB.GetLoginStatus Load denied by X-Frame-Options (Firefox Only)

主宰稳场 提交于 2019-12-01 18:04:34
I have this web application login page that calls FB.GetLoginStatus() from the Facebook JavaScript SDK after the document is done loading. This worked perfectly fine on all browsers (mobile included) and that was the happily ever after. BUT, one day, out of plain nowhere, I notice that the SDK is failing to get the login status data of the Facebook user when the page is done loading. I take a look in the console and I see something around the lines of Load denied by X-Frame-Options [massive link generated by the SDK] does not permit framing. Here's what bugs me: this works perfectly fine in

How to dynamically change facebook comments plugin url based on javascript variable?

徘徊边缘 提交于 2019-12-01 16:33:41
问题 I want to dynamically change the data-href for the fb comments plugin below based on a javascript variable. I'm running a flash swf file and am passing the new link for data-href into the html wrapper via a javascript function. When I do that, I want the fb comments plugin to refresh to the new data-href link. <div style="float: left; padding-left:5px; min-height:500px" class="fb-comments" data-href="www.example.com" data-num-posts="20" data-width="380"></div> Called javascript function

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=

FB.getLoginStatus always returns status='unknown'

别说谁变了你拦得住时间么 提交于 2019-12-01 10:33:36
If I am logged into facebook.com, I expect a call to FB.getLoginStatus will return a status='not_authorized'. Instead it returns status='unknown', even if I pass true for the 'force' parameter. If I call FB.login, and then call FB.getLoginStatus, I get status='connected'. Makes sense. If I call FB.login, reload the page, and then call FB.getLoginStatus, I get status='unknown'. Does not make sense. If I add 'true' as the second parameter (i.e. force), I still get status='unknown'. (I expect status='not_authorized' in this case.) There doesn't seem to be a way to get status='not_authorized' in

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']

New way to detect Facebook API user currency

∥☆過路亽.° 提交于 2019-12-01 09:12:25
Since currency field is deprecated form January 08, 2019, you can find user_currency in payment_mobile_pricepoints object. Don't forget to add payment_mobile_pricepoints into requested fields list FB.api("/me", {fields:"payment_mobile_pricepoints"}, function(result){ var currencyCode = result['payment_mobile_pricepoints']['user_currency']; }); Hope it helps to somebody Since currency field is deprecated form January 08, 2019, you can find user_currency in payment_mobile_pricepoints object. Don't forget to add payment_mobile_pricepoints into requested fields list FB.api("/me", {fields:"payment

Checking for event-rsvp status and showing disabled/enabled RSVP-button

試著忘記壹切 提交于 2019-12-01 09:03:23
问题 I'm still a bit unsure how I would find this in the documentation, but I'd like to check whether the logged-in user has RSVP'ed to an fb-event or not, and show the "I'm attending" button depending on that... I've already got the login-button hooked up and the proper permissions (user_events and rsvp_event), just not sure how to go about this using the JS SDK. 回答1: You can query the event_member FQL table, something like: FB.api( { method: 'fql.query', query: 'select rsvp_status from event

Facebook feed dialog: allow user to select destination page or group

早过忘川 提交于 2019-12-01 08:38:10
I'm using a Facebook feed dialog through JavaScript: var p = { method: 'feed', name: 'Title', caption: 'Subtitle - 26/02/2013', description: 'My text', link: window.location.href }; FB.ui(p) Is there a way to allow the user select the destination page for the feed ? Usually the resulting dialog allows user to post a message on his own wall. I would like to enable destination select, like: on my wall or on my page or into a group With subsequent page or group selection, as happens on Facebook site. Is there a way to show this kind of selection ? The built-in share dialog included in the

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,