Facebook的通过PHP扩展权限帆布 [英] Facebook Extended permissions in canvas via php

查看:130
本文介绍了Facebook的通过PHP扩展权限帆布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作我的新项目,Woobook。我用老REST API到现在为止,但我应该学会与最新一期(通过OAuth)工作。首先我想获得更多的权限,但附加的code重定向我到一个错误的页面(而不是直接的权限对话框)。

我的应用程序的链接: http://apps.facebook.com/woobook/

和源$ C ​​$ C:

 < PHP
// Facebook的API INC
require_onceINC / facebook.php//初始化API
$ CID =162513840463126;
$ ASI =xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
$ Facebook的=新的Facebook(阵列(
  APPID=> $ CID,
  '秘密'=> $ ASI,
  '饼干'=>真正,
));
//会议
$会议= $ facebook->的getSession();如果($ facebook->!的getUser()){
        标题(位置:$ facebook-> getLoginUrl(阵列(下一个=>中http://apps.facebook.com/woobook/,帆布=> 1,req_perms=&GT ;user_status,publish_stream,user_photos)))。
        出口;
}
?>


解决方案

您正在使用iframe应用程序,这意味着你需要以不同的方式做到这一点。

请参阅 href=\"http://stackoverflow.com/questions/3436496\">我的答案

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;
}
?>

解决方案

You're using an iframe app, which means you need to do this a little differently.

See my answer here

这篇关于Facebook的通过PHP扩展权限帆布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆