Active
Project:
Drupal for Facebook
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2012 at 22:11 UTC
Updated:
19 Jan 2012 at 16:32 UTC
The following code doesn't return either 1 or 0 as supposed to be, it returns nothing. I checked for params to be initialised. Both $_fb and $fbu has been initialised via watchdog output:
watchdog('kk2012','perm token:'.fb_get_token($_fb).' , $fbu: '.$fbu);
$fbu = $_fb->getUser();
$has_perm = fb_call_method($_fb, 'users.hasAppPermission', array(
'ext_perm' => 'publish_stream',
'uid' => $fbu,
));I checked over here to see if calling this method returns anything. It does return 1 if I use uid of a user with extended permission.
Comments
Comment #1
skolesnyk commented'Over here' I meant this link https://developers.facebook.com/docs/reference/rest/users.hasAppPermission/ .
Update: had to do everything through requesting FB methods directly like:
I checked code in fb.module for fb_call_method function -- it's practically the same, so it's strange why it didn't work for me by calling this function.
Comment #2
Dave Cohen commentedTry including 'access_token' => fb_get_token($_fb, $fbu) in your params array. that will force it to use the user's token as opposed to the application's token.
Comment #3
skolesnyk commentedThanks, Dave, will do that in next projects.)