Guy Nesher
Guy Nesher

Reputation: 1385

Detect if Facebook app is running from a fanpage (server side)

Is it possible to detect if a Facebook app is running from inside a fan page ?

I've tried using the signed_request data, but it's not being updated when the user moves from the fan page to the full app (and vice versa). Refreshing the page solves the problem (but isn't a proper solution).

I've seen other apps doing this, but I can't figure out how.

Thanks

Update: Ended up adding a GET variable to the url (Facebook allows you to use different urls for the fan page/canvas apps) and passing that variable throughout the site (couldn't use a cookie as it gave false positives when users moved between the different views of the app)

Upvotes: 0

Views: 434

Answers (1)

DMCS
DMCS

Reputation: 31870

If you cant find a serverside solution, then try this:

This bit of javascript might help determine if it's embeded in an iFrame, which is the case for a page tab app.

var isEmbeded = !(top === self); then AJAX that up to your server.

Upvotes: 4

Related Questions