facebook apprequest redirecting to domain - PHP SDK -
this first app in fb. i'm developing game in facebook. i'm using php-sdk invite friends app.
i able send requests , ids well, when when click on send request. i'm getting redirected domain.
<a href="invite.php">invite</a>
this invite.php code
<?php include("config.php"); $reqid = $_get['request']; $to = $_get['to']; if($reqid==''){ $message = "check great app?"; $url = canvas_url."invite.php"; $requests_url = "http://www.facebook.com/dialog/apprequests?app_id=".app_id."&redirect_uri=".urlencode($url)."&message=".$message; echo("<script> top.location.href='" . $requests_url . "'</script>"); }else{ echo "invite done!"; echo "invited ".count($to); exit; } ?>
i invite done! invited
why redirecting domain ??
when go through http://apps.facebook.com/app-name, still able view content in iframe within facebook facebook friends list facebook, after send requests friends i'm redirected canval_url given http://domain-name.com
thanks help.
don't know if correct solution, worked me :
after user login redirected domain.com instead of facebook/myapp so...i redirected again javascript :)
in html file:
<head> <script> if(window.location.href != 'http://domain.com/game/') window.location.href='https://apps.facebook.com/appname/'; </script> </head>
Comments
Post a Comment