Hi I modify my application recently first it just takes basic info. permission from users but now I want stream publish permission too. So I check on my index page if users not granted stream publish permission I just show him permission dialog box as follows:
<?php $permission = $facebook->api(array('method' => 'users.hasAppPermission','ext_perm'=>'publish_stream','uid'=> $uid));
if($permission != '1')
{
echo "<script type='text/javascript'>
var dialog = {
method: 'permissions.request',
perms: 'publish_stream'
};
FB.ui(dialog,null);
</script>";
}
?>
This code shows permission box properly but problem is that when user grants permission he is redirect to my canvas url (url on servers page) and not on canvas page(i.e. http://apps.facebook.com/xyz). To solve this problem I added redirect_uri to it as
var dialog = {
method: 'permissions.request',
perms: 'publish_stream',
redirect_uri: 'http://apps.facebook.com/xyz'
};
but still it's not working.
Please help me how to solve this problem.
Try this instead:
You can also use FQL to check for the permission. More about that can be found here.
UPDATE:
Facebook introduced the permissions connection and now it can be used instead of the old REST API: