问题
I'm working on my new project, Woobook. I used the Old REST API until now but i should learn to work with latest one (with OAuth). First i want to get extended permissions but the attached code redirect me to a wrong page (instead of permissions dialog directly).
My app link: http://apps.facebook.com/woobook/
and the source code:
<?php
// Facebook API inc
require_once "inc/facebook.php";
// API init
$cid = "162513840463126";
$asi = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$facebook = new Facebook(array(
'appId' => $cid,
'secret' => $asi,
'cookie' => true,
));
// Session
$session = $facebook->getSession();
if(!$facebook->getUser()) {
header("Location:".$facebook->getLoginUrl(array("next" => "http://apps.facebook.com/woobook/", "canvas" => 1, "req_perms" => "user_status,publish_stream,user_photos"))."");
exit;
}
?>
回答1:
You're using an iframe app, which means you need to do this a little differently.
See my answer here
来源:https://stackoverflow.com/questions/4763131/facebook-extended-permissions-in-canvas-via-php