簡體   English   中英

facebook 應用程序的擴展權限等

[英]extended permissions etc on facebook application

我想將兩個參數傳遞給基於 function getLoginUrl的數組$params ,順便說一句,我使用的是 php sdk 3.0。

那就是我寫的:

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

不幸的是,它不起作用? 我很確定原因是 sdk 的版本。登錄運行良好,但沒有擴展權限和下一個 url。 有什么幫助嗎? 謝謝你。

當您在評論中回答自己時,我將擴展答案。 5 月 21 日,Facebook 宣布升級 PHP-SDK,這是一次會破壞您的代碼的重大升級!

因此,檢查 SDK 工作方式的最佳方法是訪問提供的示例頁面。 現在對於您的情況,這並沒有提供太多信息,因此您應該查看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參數!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM