Facebook Extended permissions in canvas via php

旧巷老猫 提交于 2020-01-07 03:40:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!