extended permissions etc on facebook application
I want to pass two parameters to the array $params
which based on the function getLoginUrl
, btw I'm using php sdk 3.0.1.
That what I wrote:
$loginUrl = $facebook->getLoginUrl(array(
'req_perms' => 'publish_stream',
'next' => 'my next url',
));
Unfortunately, it doesn't work? I'm pretty sure that the reason is the version of the sdk.. the login is working well but without the extended permissions & next url. any help? 开发者_JAVA百科thank you.
While you answered yourself in the comments, I will extend the answer. In 21 May, Facebook announced the upgrade of the PHP-SDK which is a major upgrade that would break your code!
So the best way to check the new way the SDK works is by accessing the example page provided. Now for your case this doesn't provide much of information, so you should be looking in the base_facebook.php
and indeed you'll find (line 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
*/
Now the interesting part is the getLogoutUrl()
method as it's still using the next
parameter!
精彩评论