Facebook apps: Redirect to canvas iframe to URL within app (not main app page) -
i'm using facebook php sdk; setting app on facebook. need app run within canvas only, if user goes url, example: http://{site_url}/fbapp/index.php?this=that&that=this&etc=1
i want to: a) redirect using javascript canvas page (ie. http://apps.facebook.com/appname/) , b) iframe must go directly page within app (ie. index.php?this=that&that=this&etc=1)
i've googled moon not getting anywhere!
any ideas??
i've tried this:
var currlocation = location.href; if ( window.self === window.top && !currlocation.match('facebook') ) { location.href='https://www.facebook.com/dialog/oauth?client_id=<?= $facebook->getappid() ?>&redirect_uri=<?= $site_url; ?>?<?= $_server['query_string']; ?>'; }
it results in indefinite redirect loop between site , facebook.
instead of -
location.href='https://www.facebook.com/dialog/oauth?client_id=getappid() ?>&redirect_uri=?';
use-
header("location: canvas_url"); exit;
Comments
Post a Comment