This is a great module Dave and thank you for all the hard work.

I am encountering issues building a facebook application that uses a subdomain within the callback url. For example, there is a site at www.example.com, and the Drupal application being referenced in the canvas page is accessible at www.example.com/somemodule. Not sure if anyone has done this before, but running into all kinds of issues and just want to know if there is a better way to do things.

Here are the issues I am encountering:

1) For every form submission, the return URL formatted has to be entered without the subdomain to get it to work in facebook. So, within a submit function, the return path reads 'search/results' instead of 'somemodule/search/results', otherwise it returns a PNF. Is this the expected behavior?

2) There appears to be no way to detect within the application whether is it being viewed through facebook or straight Drupal. I imagine there has to be one in the module, given the fact the theme is different based on how the application is being viewed. Is there a standard way to do this?

3) Because the canvas page points at a subdirectory, other standard drupal modules (such as forums) are inaccessible through the facebook application. While I can enter a path alias, this doesn't cover all possible instances of where things could live or the links generated internally by Drupal. is there a good way to do this?

4) Finally, in general, it does not seem this module was designed to use subdomains within callback urls for the actual facebook applications. Is this correct or am I just missing something entirely?

Best,
M

Comments

Dave Cohen’s picture

Status: Active » Postponed (maintainer needs more info)

M,

I'm a little confused by your language. Just to be clear, you're talking about a subdirectory not a subdomain. And where is drupal installed? In your example, is www.example.com/somemodule/node/NNN a valid URL?

At any rate, the facebook application data in stored in a node. Find the node of type "Facebook Application" on your Drupal and visit that page (while logged in as administrator). The page will tell you what to use as the canvas page callback URL. If you're using the latest Drupal for Facebook, that URL will be something like www.example.com/somemodule/fb_cb/NNN. Don't make up your own callback URL, use the suggested one.

regarding #2, within the application if global variables $fb and $fb_app are set, then you are in a canvas page. The latest code also has methods fb_canvas_is_fbml() and fb_canvas_is_iframe(). One or the other will return true depending on the type of canvas page.

regarding #4, I think the thing your missing is that the callback URL is set incorrectly. If you want the user to land on a page other than the site front page, you can override the front page when editing the Facebook Application node.

Anonymous’s picture

Dave -

Thank you for the response, this was quite helpful.

To answer your questions, I am talking about a subdirectory, but perhaps not in the way you mean.

Drupal is installed at www.example.com. The Facebook callback url (specified in the Facebook application itself) is set to www.example.com/somemodule. So, www.example.com/somemodule/node/NNN would not be a valid URL, but www.example.com/somemodule does provide a valid Drupal callback specified in somemodule. I know this sounds complex, but basically it means I have users pointing at a module within Drupal as opposed to the front page of the application.

From your answer to point #4, it sounds like the callback URL in Facebook is what is breaking the form callbacks. I am going to try upgrading to the latest version of the module and pointing to the front page of the site to see if this resolves the form submit issue (#1 in original post). I believe this would also solve point #3 above.

I get what you mean about #2.

M

giorgio79’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Reopen if still exists in 6x or 7x