First off,
The module works wonderfully and the API along with its documentation is fantastic.
Right now, if I need to initate any facebook action, I output a link using
fboauth_action_display('my_custom_action');
When a user clicks on it, a popup with request for relevant permission turns up etc.
I was wondering if it was at all possible to initiate the popup (i.e. the facebook request) when a user browses to a given path say 'something/my_custom_action_page' which is implemented as a MENU_CALLBACK in my custom module.
AFAI-understand, the callback provided for a custom action takes the app_id and the access_token as params. I was thinking of making the menu item's callback the same as the action callback. I am thinking correctly. Is there a API function provided by fboauth that I have somehow missed that would let me do this?
Thanks.
Comments
Comment #1
v-a-1 commentedI meant "Am I thinking correctly?". Sorry.
Comment #2
quicksketchThe README.txt describes what you need I think:
You can call fboauth_action_link_properties() in your menu callback, then use
drupal_goto($link['href'])to immediately initiate the action, taking the user to Facebook's website for confirmation.Comment #3
v-a-1 commentedThanks! That put me in the right direction.
However,
drupal_goto($link['href'])doesn't work directly, because the query params are not attached to the link yet.
This is what works: (I call it from my menu callback).
Thanks again.
Comment #4
quicksketchRight, right of course. I think you can actually pass those arguments directly to drupal_goto() also, but it's probably more clear the way you've written it.
Comment #5
quicksketch