I am developing a facebook application. I am not sure about getting extended permission from the user. I have seen a code related to this but it is not working well. The code has the problem that if there is a new user and comes to application,, he will be asked for all e开发者_如何转开发xtended permissions to authorize. But one he authorize and i again add some extra extended permission and want to get that data, the pop window will not be displayed and i cannot access the user data of that newly added permission. I am using the following code for this
$facebook = new Facebook(array( 'appId' => 'xxxxxxxxx', 'secret' => 'xxxxxxxxxxxxxxxxxxx', 'cookie' => true, )); session = $facebook->getSession(); $loginUrl = $facebook->getLoginUrl( array( 'canvas' => 1, 'fbconnect' => 0, 'req_perms' => 'email,publish_stream,offline_access,sms,user_location,friends_birthday' ) ); $fbme=null; if (!$session) { echo "top.location.href = '$loginUrl';"; exit; } else { try { $uid = $facebook->getUser(); $fbme = $facebook->api('/me'); } catch (FacebookApiException $e) { echo "top.location.href = '$loginUrl';"; exit; } }
Now if any user comes on this point he will be asked for all permission and I can get data for all those permission. But if i add new extended permission, the user that has already authorized my application will not be asked for new permission and I cannot get the data for newly added permission.
I think if you got the extended permission then facebook will not ask for the same again when that user login to your application after some time.You can see the application that you authorized in the application page.
So to ask the permission again from same user he/she must remove the permission or remove the application from his/her account.
And if the user already give permission to your application then you can use that access token.Check this
精彩评论