I am using the following code to generate Fconnect button in my web application to integrate Fb login.
Previously this code was working fine. but now its not showing me the fconnect button in my webpage.
what is wrong with this code. Or is there any changes to the facebook Api?
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" ></script>
<div id="fb-root"></div>
<script type="text/javascript" language="javascript">
FB_RequireFeatures(["XFBML"], function () {
FB.init(MY_App_ID, Domain_Path + "xd_receiver.htm");
});
</script>
<fb:login-button length='short' size='medium' onlogin="facebook_onlogin_ready()" ></fb:login-button>
Related
I tried to integrate facebook invite feature as follow! when I clicked on button click here it not shows me a dialog for me ( real is it shows about 0.1 second then it hiddens) ... Anybody can help me resolve this problem ! thank you!
this is my code:
<html>
<head>
<title></title>
</head>
<body>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId:'233108243711708',
cookie:true,
status:true,
xfbml:true
});
function InviteF()
{
FB.ui({
method: 'apprequests',
message: 'Welcome to 2my4edge',
});
}
</script>
<a href="#try" onclick="InviteF();">
Click Here
</a>
</body>
</html>
You should use the Send dialog to achieve what you want to do.
https://developers.facebook.com/docs/sharing/reference/send-dialog
I am Using the following code to use Fconnect in my website:
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" ></script>
<div id="fb-root"></div>
<script type="text/javascript" language="javascript">
FB_RequireFeatures(["XFBML"], function () {
FB.init(MY_App_ID, Domain_Path + "xd_receiver.htm");
});
</script>
<fb:login-button length='short' size='medium' onlogin="facebook_onlogin_ready()" ></fb:login-button>
previously the following code was returning the Session Key but now its not.
FB.Facebook.apiClient.get_session()
its giving Undefined error
How i can get User SessionKey using the Facebook Jascript Api.
That code is using a deprecated API which is no longer supported and could be removed at any time as it's scheduled for deletion.
The current Javascript SDK uses OAuth access tokens, not session keys.
I'm trying to get the registration flow for Facebook login working. Here's a bare-bones example:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>My Facebook Login Page</title>
</head>
<body>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<div id="fb-root"></div>
<script type="text/javascript">
FB.init({
appId:'xxxxxxxxxxx',
cookie:true,
status:true,
xfbml:true,
channelUrl : 'http://<myWebSite>/channel.html',
oauth:true
});
</script>
<fb:login-button registration-url="http://<myWebSite>/register"/>
</body>
</html>
(The only things I've replaced above are the website and the appID)
If I try it like this, the login button shows up, but clicking it causes FireBug to report 'Unknown status: undefined' in the browser log. If I remove the 'oauth=true' line though, it works. I'm trying to adhere to the new oauth 2.0 standard, so I'd like to leave it in. Has anyone else run into this? Seems like if this was a bug, it would have been caught pretty early on.
the 'registration-url' parameter is no longer supported by , take a look in the documentation of it. http://developers.facebook.com/docs/reference/plugins/login/
Just check if the user is logged in via the JS-SDK
I am trying to find a walk through on how to register users via facebook onto my site.
The facebook developers site keeps confusing me and I was hoping there where easier tutorials to follow.
Stephen,
It can be a little complicated.
You have to combine the documentation at:
http://developers.facebook.com/docs/guides/web/
http://developers.facebook.com/docs/plugins/registration/
Boiling it down to the simplest case:
<html>
<head>
<title>My Facebook Registration Page</title>
</head>
<body>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js">
</script>
<script>
FB.init({
appId:'yourAppID', cookie:true,
status:true, xfbml:true
});
</script>
<fb:registration
fields="[{'name':'name'}, {'name':'email'},
{'name':'favorite_car','description':'What is your favorite car?',
'type':'text'}]" redirect-uri="Your processing URL">
</fb:registration>
</body>
</html>
Facebook will return an encrypted form field with all the user data called "signed Request" You will need to decrypt this field with your secret key. There is an PHP example at the bottom of http://developers.facebook.com/docs/plugins/registration/
Can some one please tell me what is wrong with below code? After I login it doesn't do anything: neither reloading the page nor setting the login FB cookies.
It's simple code but I'm not sure what I'm doing wrong.
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
<script type="text/javascript">
FB.init(FB_API_KEY, "xd_receiver.htm",{"reloadIfSessionStateChanged":true});
</script>
<a href='#' onclick='FB.Connect.requireSession(); return false;'> <img id='fb_login_image' src='fblogin.jpg' alt='Connect' /> </a>
Did you configure your application in "Connect" tab in www.facebook.com/developers/yourapp?