Reputation: 4974
$facebook = new Facebook($configs);
$uid = $facebook->getUser();
if($uid) {
// Do stuffs
} else {
$loginUrl = $facebook->getLoginUrl();
echo('<script> top.location.href = "' . $loginUrl . '";</script>');
}
?>
All work perfectly, but, if user are not logged, the script redirect to Facebook which ask login. When login, the script redirect to my application external url http://mywebsite.com/facebook-app
and not my apps.facebook.com/myappid
.
Upvotes: 2
Views: 677
Reputation: 28480
Check that the URLs on the apps settings page on Facebook Developer are correct. If your app is of the 'App on Facebook' type, check that
Canvas URL
Secure Canvas URL
are correct.
If it's a 'Mobile Web' app, check
Mobile Web URL
and so on depending on the type of app.
Upvotes: 1
Reputation: 1077
Try adding this to your $loginUrl
:
$loginUrl = $facebook->getLoginUrl(array(
'next'=>'http://apps.facebook/myappid'
));
Haven't encountered this problem in particular, but this might be of use !
Upvotes: 1