Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

facebook connect--how to make use of makeRequest for publishing


Go to End


4 Posts   2309 Views

Avatar
theoldlr

Community Member, 103 Posts

9 March 2011 at 10:02am

I see the protected function makeRequest which seems like it could be used to publish to a friends wall, but I am not sure the proper way to access it. In my case I would like to use it from a Form's Actions function, using data submitted by the user to publish to someones wall.

These are pretty facebook specific question here, but I'll throw it out just in case somebody knows off the cuff--
In order to publish to a friend's wall I will also need to be granted higher permissions than the module requests by default, yes? I believe this can be done with the set_permissions function, but after setting them how do you re-request the user to authorize them?

Avatar
Willr

Forum Moderator, 5523 Posts

9 March 2011 at 10:01pm

ll I will also need to be granted higher permissions than the module requests by default, yes? I believe this can be done with the set_permissions function

Yes you will need to ask for permissions related to posting to the wall. Check the fb docs for more information on the available permissions

I see the protected function makeRequest which seems like it could be used to publish to a friends wall, but I am not sure the proper way to access it. In my case

Currently the module does not wrap any of the facebook API methods. It does however, give you access to the base Facebook API. From there you can do crazy and do your own things..

// your controller
$fb = $this->getFacebook();
$fb->api('/willrossiter/feed'); 

Facebook has some really nice documentation available https://developers.facebook.com/docs/reference/api/

Avatar
theoldlr

Community Member, 103 Posts

10 March 2011 at 1:07pm

Thank for the reply... I'm struggling with how to prompt for the extended permissions though. I can't make facebook JS calls such as

 Facebook.showPermissionDialog('publish_stream', ondone, false, '');
without getting errors. Doesnt the module take care of setting that up? I'm a lost.

Avatar
Willr

Forum Moderator, 5523 Posts

10 March 2011 at 1:23pm

You can use FacebookConnect::set_permissions($permissions) to set what permissions the module asks for. Not sure if it works but it should reask the user if your application hasn't got all the permissions required.