× Joomla Facebook Connect support forum

Topic-icon Granting Publish Actions Permissions[solved]

Active Subscriptions:

None
14 years 5 months ago #17742 by Ivan
Hi
I had previously asked about checking for publish action permissions when a user that has already connected logs into my site since im trying to publish achievements. See link below. I could not continue on that threads seems locked.

www.sourcecoast.com/forums/jfbconnect/jf...-publish_actions#top

I had not looked back at the post since I just deleted my fb user account and created a new one on the site which prompted me for permissions on connecting. However I would still like that previous users who have not been granted permissions be prompted for this again.

Is it possible to do something like this when logging in?

Where in the jfbconnect code could this be optimally implemented?

I've noticed this code

$permissions = $facebook->api("/me/permissions");

if( array_key_exists('publish_stream', $permissions[0]) ) {
// Permission is granted!
// Do the related task
$post_id = $facebook->api('/me/feed', 'post', array('message'=>'Hello World!'));
}
else { // We don't have the permission
// Alert the user or ask for the permission! header( "Location: " . $facebook->getLoginUrl(array("scope" => "publish_stream")) );
}
The topic has been locked.
Support Specialist
14 years 5 months ago #17744 by alzander
Ivan,
If you configure JFBConnect to request that permission, it will automatically be asked on login if the user hasn't already granted it. That should happen always, and you shouldn't need to do anything else. I think that's what you're looking for, but if it's not asking that on login (not just registration), I'm not sure why that would be.

If I'm missing something, let me know,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 5 months ago #17748 by Ivan
Well on my site I have trid to login with users that have already connected before i added :

$requiredPerms = "email,publish_stream,publish_actions,user_photos";

and when i login with a test user i dont see any popup that asks for this permission again. So because of this i would like to first detect if these users have this permission and if they do not then i need to prompt them for it.

Or else when I try to process an achievement for a user it would give a #200 error requires extended permission publish_actions
The topic has been locked.
Support Specialist
14 years 5 months ago #17760 by alzander
Ivan,
You shouldn't need to be messing with the PHP to do this. The permission, when added to the "Additional Permissions Request:" box of JFBConnect should automatically be requested of the user. With JFBConnect v4.1, all of the permissions will be requested of the user by default (there are no optional vs required permissions) as Facebook is updating their dialog box in a way that required permissions doesn't really make sense.

Hope that helps explain,
Alex
The topic has been locked.