facebook-javascript-sdk

dynamically added Facebook send button not rendering

夙愿已清 提交于 2019-12-05 01:51:06
问题 I'd like to add a Facebook send button (which is not yet supported with iframes) dynamically to the page after it loads (due to the way the site is constructed, it will be part of an HTML template loaded through AJAX on a user action). Though I'm importing the FB JavaScript SDK, when I load the new content through AJAX, the marked element is not "transformed" into the FB send button. I've tried: <div class="fb-send" data-href="example.com"></div> and <fb:send href="example.com"></fb:send> Any

Facebook FB.login works in Safari, but not mobile Safari

ぃ、小莉子 提交于 2019-12-05 01:19:52
The following FB.Login function works fine in desktop Chrome, FF, and Safari. But in mobile Safari (tested on an iPhone 4S), it hangs and does not return to the FB.login callback. I can also see this in the console when I use Safari and set the User Agent to "Safari iOS 4.3.3 - iPhone". Is it because mobile Safari blocks popups? (FB.login triggers a popup dialog). How do I fix this? Thanks. function Login(returnLink) { FB.login(function(response) { if(response.status === 'connected') { console.log('User is now FB logged in.'); // now log them into my site encodedReturnLink = encodeURIComponent

FB.ui() giving error in Safari with asynchronous request when user is not already logged in

ε祈祈猫儿з 提交于 2019-12-05 00:30:15
问题 I'm trying to get have users be able to post to their Facebook walls on my external site. I've encountered a problem in Safari. If the user isn't logged in, i.e. they have not gone through the flow that calls FB.login(), I get the following JS error when calling FB.ui(): TypeError: 'undefined' is not an object (evaluating 'b.fbCallID=a.id') However, if they are logged in, the dialog appears just fine. FB.ui() is called in a callback function -- I'm retrieving a unique url from my server, and

Get Facebook user's profile picture prior to authenticating app

依然范特西╮ 提交于 2019-12-04 22:58:29
问题 Summary: I am working on a website that connects to Facebook through the Graph API. I was asked whether I can get a user's profile picture if they are already logged into Facebook, but prior to the user authenticating the app. Is this possible? EDIT: I know you can get people's profile picture by going to http://graph.facebook.com/USERNAME_OR_USERID/picture?type=large , but would I be able to get a user's username or ID if they are logged into Facebook, but have not authorized my app? Details

What is the X-FB-DEBUG header returned from Facebook?

笑着哭i 提交于 2019-12-04 22:29:34
I'm wondering what the header mentioned above is. It's included in the response when I do JSONP calls to Facebook, or even when I simply access http://static.ak.fbcdn.net/ I haven't found any documentation on facebook, e.g. on https://developers.facebook.com/docs/reference/ads-api/etags-reference/ So, hope somebody can help me. thx! To me, this seems to be a request tracking id, so that Facebook can find and trace an specific request details [faster] when you fill in a bug report. Have seen them in lots of bug reports on their bug tracker. A little late, but just to add more information that I

facebook multi-friend selector( javascript SDK), counting number of friends

六月ゝ 毕业季﹏ 提交于 2019-12-04 22:00:23
Hi i just wanted to know, is there any way to know how many friends the user selects from the multi-friend selector generated by the following code. function InviteFriends(){ FB.ui({ method: 'apprequests', message: 'come on man checkout my application.'}); } thanks Yes, Facebook will send back the request_ids for all the requests sent. so the number of requests would equal the number of friends selected. How to access the request_ids is described in this tutorial: How To: Send An Application Request Using The Facebook Graph API FB.ui({ method: 'apprequests', message: 'Check out this

How to publish Actions to Facebook Graph API with parameters in call URL

≡放荡痞女 提交于 2019-12-04 21:58:09
To begin, Ive spent several hours looking for an answer and have come CLOSE but havent found a full answer. So Im trying to publish actions using Facebook's Graph API and want to send parameters in the URL when initially calling it with the Facebook Javascript SDK. Here is a call that WORKS: function postNewAction() { passString = '&object=http://mysite.com/appnamespace/object.php'; FB.api('/me/APP_NAMESPACE:ACTION' + passString,'post', function(response) { if (!response || response.error) { alert(response.error.message); } else { alert('Post was successful! Action ID: ' + response.id); } } );

Why FB.ui does not work even after loading javascript sdk?

*爱你&永不变心* 提交于 2019-12-04 18:55:21
I am just wasting time from last one week trying to figure out what goes wrong in this particular SIMPLE code sample. Firefox's Error Console says 'FB.ui not defined'. I tried to fix this by placing the code that loads javascript sdk in every possible way. But theres no effect. And all the firefox says is 'FB.ui not defined'. Someone help me out please. Thanks. (Note: I ve replaced the XXX... with ma APPID) <html> <head> <title>My Great Website</title> </head> <body> <div id="fb-root"></div> <script> var publish = {method: 'stream.publish',display: 'popup', // force popup mode attachment: {

ckeck if user like Facebook page or not without request Access Token

别来无恙 提交于 2019-12-04 18:53:40
window.fbAsyncInit = function() { FB.init({ appId : '********', // App ID channelUrl : document.location.protocol + '//connect.facebook.net/en_US/all.js', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); var fql_query = "SELECT uid FROM page_fan WHERE page_id = "+page_id+"and uid="+user_id; FB.Data.query(fql_query).wait(function(rows) { if (rows.length == 1 && rows[0].uid == user_id) { console.log("LIKE"); $('#container_like').show(); } else { console.log("NO LIKEY"); $('#container

FB is undefined even though I just used it

浪子不回头ぞ 提交于 2019-12-04 18:13:59
问题 I am trying to add a Facebook Like button to a widget that I am creating. The code that I use to add the Facebook like button to my page is as follows: widget.html <body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : '263071593731910', status : false, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); }; (function() { var e = document.createElement('script'); e.src = document