Facebook request form not working in HTML - facebook

I am using facebook request form for my facebook iframe fanpage,
I am using below code for this
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
FB.Canvas.setAutoResize();
</script>
</head>
<body>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js"></script><script>
FB.init({
appId:"APP_ID", cookie:true,
status:true, xfbml:true
});
</script>
<fb:serverFbml width="760px">
<script type="text/fbml">
<fb:fbml>
<fb:serverFbml style="width: 755px;">
<script type="text/fbml">
<fb:fbml>
<fb:request-form
action="<URL for post invite action, see fb:request-form docs for details>"
method="POST"
invite="true"
type="XFBML"
content="This is a test invitation from XFBML test app
<fb:req-choice url="see fb:req-choice docs for details."
label="Ignore the Facebook test app!" />
">
<fb:multi-friend-selector
showborder="false"
actiontext="Invite your friends to use Facebook." />
</fb:request-form>
</fb:fbml>
</script>
</fb:serverFbml>
</fb:fbml>
</script>
</fb:serverFbml>
The code was working ok earlier around 15-20 days back, now the same is not working. Now only loading frame appears instead of list of friends.
Please suggest how to overcome this issue?
Thanks in advance for the help

this works (for the time being): http://www.ajado.com/blog/embedding-a-xfbml-facebook-friend-invite-request-form-javascript-only/
however, i did not find a way to get this part working:
<fb:req-choice url="see fb:req-choice docs for details."
label="Ignore the Facebook test app!" />
">

Related

Facebook invite feature not working on my website

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

How can I register facebook users on my site ?

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/

Facebook multi-friend-selector always displays email invite section

I managed to get fb:multi-friend-selector working. However after choosing friends and sending invitations to them there is a popup "Optional: also send to email contacts?" displayed which I don't want.
According to the documentation at http://developers.facebook.com/docs/reference/fbml/multi-friend-selector there is a email_invite flag indicating whether this popup should be displayed or not.
For me it's always displayed no matter if I set email_invite="true" or email_invite="false".
Anyone knows how to get rid of this popup?
Below is the code I generate:
<fb:serverfbml>
<script type='text/fbml'>
<fb:request-form
action="http://example.com"
content="Your friend invites you to Test site <fb:req-choice label="Accept" url="http://example.com/" />"
invite="true"
method="post"
type="Test site">
<fb:multi-friend-selector
actiontext="Invite your friends to Test site"
bypass="cancel"
condensed="false"
email_invite="false"
exclude_ids=""
max="20"
showborder="true" />
</fb:request-form>
</script>
</fb:serverfbml>
I had the same problem and added the parameters to remove the popup :
email_invite=false
import_external_friends=false
ie.
<fb:serverfbml>
<script type='text/fbml'>
<fb:request-form
action="http://example.com"
content="Your friend invites you to Test site <fb:req-choice label="Accept" url="http://example.com/" />"
invite="true"
method="post"
type="Test site">
<fb:multi-friend-selector
actiontext="Invite your friends to Test site"
bypass="cancel"
condensed="false"
email_invite=false
import_external_friends=false
exclude_ids=""
max="20"
showborder="true" />
</fb:request-form>
</script>
</fb:serverfbml>

FB Init - reloadIfSessionStateChanged is not working

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?

Resume FB Connect session

i am using FB Connect on my site and i am able get & store offline access session key in DB.
My question, i need to display the multiple friend selector form even if there is no FB connect session.
How can i force it to resume/create the session i have in DB, so i can display friends in the below form.
Since i already got extended permissions, I must not ask them for login again. please help
require_once 'config.php';
$user = "1294712371";
$session = "827466297c301f2cc6b581ce-1294712371";
?>
<fb:serverfbml style="align:center;">
<script type="text/fbml">
<fb:fbml>
<fb:request-form
action="test.php"
method="POST"
invite="true"
type="dot.com"
content="Come and join me"
<fb:req-choice url='see wiki page for fb:req-choice for details'
label='Join Me' />
<fb:multi-friend-selector showborder="false"
actiontext="Invite your friends">
</fb:request-form>
</fb:fbml>
</script>
</fb:serverfbml>
<script src="JS/FeatureLoader.js" type="text/javascript"></script>
<script type="text/javascript">
FB_RequireFeatures(["XFBML"], function()
{
FB.init('appapikey', "xd_receiver.htm");
});
</script>
Currently the above code shows no friends at all when there is no FB connect loggedin sesstion
You could use set_user method from the php client library
$facebook = new Facebook(API_KEY, API_SECRET);
$facebook->set_user($user, $session);