facebook-javascript-sdk

Get user basic information using facebook Login button plugin?

梦想的初衷 提交于 2019-11-27 13:07:47
问题 Here I am using Facebook Login button plugin and javascript sdk I am able to successfully login and logout by using above. When a first time user has gone through authentication process I need to store user basic information i.e. Facebook login name, email in my database. Please suggest how I can do this. <p><fb:login-button autologoutlink="true"></fb:login-button></p> <div id="fb-root"></div> <script> window.fbAsyncInit = function () { FB.init({ appId: '123456', status: true, cookie: true,

Facebook new javascript sdk- uploading photos with it!

核能气质少年 提交于 2019-11-27 12:57:46
I am trying to upload a photo to facebook album with this javaascript code. FB.api('/me/photos', 'post', { access_token: GetToken(), name: 'uploaded photo', source: '@http://example.com/example.jpg' }, function(response) { if (!response || response.error) { alert('Error occured ' + response.error.message); } else { alert('Post Id: ' + response.id); } }); Can someone help me with this code. This code is not returning anything. Assuming you want to do this in pure JavaScript/JQuery - you'll need to use an iframe as the target of a form, there is a caveat - you will not be able to use the return

How can I make the Facebook Like button's width automatically resize?

拥有回忆 提交于 2019-11-27 11:08:27
问题 I'm implementing the Facebook Like Button, but I'm running into some trouble with the width. I'm using the JavaScript SDK implementation, not the direct iframe. According to the documentation, the default width is 450 . That's fine, and I understand that the width can be changed by way of the width attribute on the <fb:like> tag. However, my problem is that I really cannot specify a fixed width. Due to the nature of the button, the width is not constant in all states. For example, if no one

How do you animate FB.Canvas.scrollTo?

落花浮王杯 提交于 2019-11-27 10:59:32
问题 I've created an app that is a set size (around 2,000 px tall) and have a menu that calls FB.Canvas.scrollTo in order to help the user navigate the long page. Is there any way to add a smooth scrolling effect? Facebook does not offer any solution on its developer blog. 回答1: Using @Jonny's method, you can do this a little more simply with function scrollTo(y){ FB.Canvas.getPageInfo(function(pageInfo){ $({y: pageInfo.scrollTop}).animate( {y: y}, {duration: 1000, step: function(offset){ FB.Canvas

How to get access token from FB.login method in javascript SDK

a 夏天 提交于 2019-11-27 10:11:30
I need to get the access token from FB.login method in Javascript SDK. My login code is FB.login(function(response) { if (response.session) { if (response.perms) { } else { // user is logged in, but did not grant any permissions alert("No Permission.."); } } else { // user is not logged in alert("Please login to facebook"); } }, {perms:'read_stream,publish_stream,offline_access'}); Is there any way to get access token? I am able to get the access token using PHP . Pavel Surmenok You can get access token using FB.getAuthResponse()['accessToken'] : FB.login(function(response) { if (response

FB.login broken flow for iOS WebApp

前提是你 提交于 2019-11-27 10:03:19
问题 I'm making an iOS Webapp (i.e. an HTML page that runs in standalone mode - none of the Safari chrome - when the bookmark of the page is added to the homescreen). I have a button that onclick calls FB.login(). When in standalone mode, the webapp redirects to the facebook login page (as expected), however afterwards, I get stuck on a white screen (I don't get asked to authenticate since I already have, but I imagine that the authentication screen would happen before the white screen) and don't

Facebook and Cross domain messaging clarification?

别说谁变了你拦得住时间么 提交于 2019-11-27 09:47:33
问题 I wanted to investigate how the facebook login transfer data to the main page ( mypage) - despite the cross domain boundary limitation. And so I created a new page with the FB js sdk code : FB.login(function (response) { if (response.authResponse) {... It does open the popup : But when I investigated to see if I have any Iframes on my page ( My code doesn't contain any iframes) : I saw this : >>$("iframe") result : [ <iframe name=​"fb_xdm_frame_http" frameborder=​"0" allowtransparency=​"true"

Suggest Page to friends using PHP-SDK

天大地大妈咪最大 提交于 2019-11-27 08:53:11
问题 How to implement "Suggest MY-PAGE to friends" using PHP-SDK or using Javascript SDK? 回答1: First you need the Facebook SDK bundle that contains base_facebook.php, facebook.php and fb_ca_chain_bundle.crt . You will also need fbmain.php and config.php . Next you should have a file (e.g postToWall.php) that includes fbmain.php <?php include_once "fbmain.php"; ?> An example of postToWall.php file. <html> <body id="my_body"> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB

Facebook Graph publish posts with link and custom picture not working on v2.9

痞子三分冷 提交于 2019-11-27 08:05:53
问题 I remember when I was using Graph v2.8, I could set custom picture and caption for link. Now it is impossible for v2.9. Is there some kind of workaround without specifying og: tags. How it was on v2.8: How it is now on v2.9: 回答1: Unfortunately there is currently NO publicly known workaround. According to facebook developers blog: As part of our continuing efforts to stop the spread of misinformation and false news on our platform, earlier this year at F8 we announced an important change to

Warning: This page calls for XML namespace http://www.facebook.com/2008/fbml declared with prefix fb but no taglibrary exists for that namespace

血红的双手。 提交于 2019-11-27 06:19:56
问题 I am developing an application for FB Login with website using Javascript. I tried in html it works fine. when i convert into JSF it gives an error. This is my fbLogin.xhtml code. <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:fb="http://www.facebook.com