facebook-javascript-sdk

More action links in single wallpost

人盡茶涼 提交于 2019-12-03 17:30:07
Is it possible to create wallpost with more than one action link? My code works only with one action link. Wallpost with two action links is not sent to Facebook (no error message). var publish = { method : 'feed', name : name, link : link, picture : picture, caption : caption, description : description, message : message, actions : [{ name : 'Link 1', link : 'http://www.example.com' },{ name : 'Link 2', link : 'http://www.example2.com' }] }; FB.api('/me/feed', 'POST', publish, function(response) {}); I got a response from Facebook and you really can not add more than one action link . Correct

Requests Dialog only works with Canvas-View?

走远了吗. 提交于 2019-12-03 16:44:45
I've some page-tabs for a few fanpages and there I'd like to integrate the RequestDialog. But unfortunately it always tries to redirect the friend, that got a request, to the canvas page. Is there a way to send the user to the page-tab, where his friend initially started the request dialog? Thanks in advance, Jurik Accepting a request will always go to the canvas page with the request_ids parameter added. See the "User Response" section of this doc: https://developers.facebook.com/docs/reference/dialogs/requests/ Obviously you could write code to detect when the user arrives with the request

dynamically added Facebook send button not rendering

柔情痞子 提交于 2019-12-03 16:19:29
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 suggestions? Whenever you add an FBML element to the dom you should call FB.XFBML.parse(); http:/

How to upload video on facebook using FB.ui Javascript sdk

假装没事ソ 提交于 2019-12-03 16:06:15
I'm using FB.ui method to post image to facebook as described below: FB.ui({ display: 'popup', method: 'feed', name: 'image', link: 'link', picture: 'image path', caption: 'caption', description: 'description' }, function(response){ // do something }); I'm able to post image successfully, but couldn't post video. I have tried, but failed. FB.ui({ display: 'popup', method: 'feed', link: 'link', picture: 'thumbnail image path', source: 'https://example.com/media/video.mp4', caption: 'caption', description: 'description' }, function(response){ // do something }); above approach is posting feed, I

Facebook API Javascript JSON response

亡梦爱人 提交于 2019-12-03 15:09:42
问题 function getUser() { FB.api('/me', function(response) { console.log('Response is '+response); alert('Your name is ' + response.first_name); alert('Your last name is ' + response.last_name); alert('Your Gender is ' + response.gender); alert('Your status is '+response.username); } How can I get the entire response like this below printed? { "id": "blah blah", "name": "blah blah", "first_name": "blah blah", "last_name": "blah blah", "link": "https://www.facebook.com/blah blah", "username": "blah

Chrome-only cross-domain scripting errs in Facebook iFrame App upon FB.Login(..)

廉价感情. 提交于 2019-12-03 13:31:07
In Google Chrome (I'm on 9.0.597.98) my Facebook iFrame app using Graph API/Javascript SDK tends to always throw the following two JavaScript errors (see below) based on cross-domain scripting, but only on one page of the app. It goes into an endless retry loop on the second message. After leaving it overnight, it reported a half million retries by this morning! The FB call being used is for login: FB.login(function(response) { if (response.session) { // user successfully logged in } else { // user cancelled login } }); In Firefox and IE9 I do not get these errors. It's specific to Chrome

posting to friends wall using facebook javascript sdk

烂漫一生 提交于 2019-12-03 12:03:48
问题 How can I post to a friends wall using the facebook javascript SDK? 回答1: In addition to @ifaour's answer on FB.api ... Set oauth and status parameters in FB.init Request extended permission, publish_stream, via FB.login Other resources: using facebook stream publish Complete example... <script> window.fbAsyncInit = function() { FB.init({ appId : 'APP_ID', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true , // parse

Facebook JavaScript SDK: FB.ui opens a popup window

房东的猫 提交于 2019-12-03 11:06:49
I am trying to show a 'Post to Your Wall' feed dialog with the following code in a facebook iframe app: <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"> </script> <script> FB.init({ appId:'249725835046216', cookie:true, status:true, xfbml:true }); FB.ui({ method: 'feed', message: 'Facebook for Websites is super-cool', name: 'Facebook Dialogs', link: 'http://developers.facebook.com/docs/reference/dialogs/', picture: 'http://fbrell.com/f8.jpg', caption: 'Reference Documentation', description: 'Dialogs provide a simple, consistent interface for applications to

Multiple fbAsyncInit's?

非 Y 不嫁゛ 提交于 2019-12-03 08:54:11
In my site I'm using asynchronous loading of the Facebook JS SDK. To actually set it up I use the standard FB.init inside of window.fbAsyncInit function. However the issue is that in my site this function is on every single page. However when I'm in a subpage I can't directly add to the JS function due to the design of my site, I have to copy and paste the whole function and add my bits. I don't think multiple fbAsyncInit's are possible, so whats the best way to implement this? You can use this instead to check if you already have a fbAsyncInit and chain it toghether in that case: var oldCB =

display photos from facebook with javascript api?

六眼飞鱼酱① 提交于 2019-12-03 08:53:09
I want to display photos from one of my facebook albums on my webpage with the javascript api. I can read the album names with the below code, but how can I then display the photos of one of the albums? FB.api('/myfacebookid/albums', function(response) { var ul = document.getElementById('albums'); for (var i=0, l=response.data.length; i<l; i++) { var album = response.data[i], li = document.createElement('li'), a = document.createElement('a'); a.innerHTML = album.name; a.href = album.link; li.appendChild(a); ul.appendChild(li); } }); Any input appreciated, thanks! OK, now I have this code