I’m trying to gets new user whit Facebook Requests. Unfortunally when an user accept the invite from facebook he is redirected to https://www.facebook.com/?request_ids=xxxxxxxxxxx
and not to my website. i tryed to pass the userid to facebook but i don’t receive any “postback”. what it’s wrong whit my app? i need to change app settings or is my code wrong?
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
function invitefacebook(){
FB.init({appId: 'xxxxxxxxxxxx', xfbml: true, cookie: true});
FB.ui({
method: 'apprequests',
message: 'I invite you in this awesome website!',
data: '<?php echo $id; ?>'});
}
</script>
<a onclick="invitefacebook();">Invite Friends</a>
Thanks in advance 😀
Even though it redirects to the facebook.com you can see your application either as an iframe or as a tab inside that url itself.
so you should code your app such that you do something when you get the request_ids in the url..
So do something like this
The above code should present in the page which will be displayed as an iframe when the user is redirected to the app.