Facebook应用程序的扩展权限等

时间:2011-06-12 23:12:57

标签: php facebook

我想将两个参数传递给基于函数$params的数组getLoginUrl,顺便说一下我使用的是php sdk 3.0.1。

我写的:

$loginUrl = $facebook->getLoginUrl(array(
                                          'req_perms' => 'publish_stream',
                                          'next' => 'my next url',
                                            ));

不幸的是,它不起作用?我很确定原因是sdk的版本..登录运行良好,但没有扩展权限&下一个网址。任何帮助?谢谢。

1 个答案:

答案 0 :(得分:1)

当你在评论中回答时,我会延长答案。在21 May,Facebook宣布升级PHP-SDK,这是一个破坏你的代码的重大升级!

因此,检查SDK工作方式的最佳方法是访问提供的example页面。现在,对于你的情况,这并没有提供太多信息,所以你应该查看base_facebook.php,你确实会找到(第449行):

/**
* Get a Login URL for use with redirects. By default, full page redirect is
* assumed. If you are using the generated URL with a window.open() call in
* JavaScript, you can pass in display=popup as part of the $params.
*
* The parameters:
* - redirect_uri: the url to go to after a successful login
* - scope: comma separated list of requested extended perms
*
* @param array $params Provide custom parameters
* @return string The URL for the login flow
*/

现在有趣的部分是getLogoutUrl()方法,因为它仍在使用next参数!