Ben geri facebook sayfasında app sekmesine yetki sonra kullanıcı yönlendirme ile ilgili sorunlar var. Ben her zaman bağımsız uygulama tuval sayfa sonunda.
Edit: It was meant to be an app in tab within a Fb page. I wanted to do the authorization and then to redirect user back to page tab. But when you do this the tab looks just like before and it seems to user like an error because he came from authorization and the app in tab looks the same. He has to click on it to get some kind of response or message.
Indirilebilir herhangi bir örnek veya adım-adım öğretici bir tür var. İşte benim kod:
// Create our Application instance.
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
'cookie' => true,
));
//Facebook Authentication part
$session = $facebook->getSession();
$loginUrl = $facebook->getLoginUrl(
array(
'canvas' => 1,
'fbconnect' => 0,
)
);
$uid = null; //facebook user id
$fbme = null;
if (!$session) {
echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
exit;
}
else {
try {
$uid = $facebook->getUser();
$fbme = $facebook->api('/me?fields[]=id&fields[]=last_name&fields[]=first_name');
}
catch (FacebookApiException $e) {
echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
exit;
}
}