I have a page tab application with a share button that invokes the Facebook feed dialog. I want the story link to point back to the page tab application. How can I find out the page tab url from within the page tab app itself? I cannot use top.location.href because of cross-domain security issues, but I don’t see how else the application itself can figure out the necessary url. Specifying the page tab app in a config setting is not an option – too fragile and prone to maintenence problems (i.e. publish from staging to prod without updating url).
I have a page tab application with a share button that invokes the Facebook
Share
It’s a bit roundabout, but it’s fairly solid.
The
signed_requestwill give you apage_id. You can then query the graph api for thelinkparam on that Page ID. Combo that withapp_<APP_ID>and you’ve got your URL.eg – https://www.facebook.com/colmstestpage/app_120999667956026
https://www.facebook.com/colmstestpage/ comes from
http://graph.facebook.com/<PAGE_ID>?fields=linkand/app_120999667956026is consistent and you don’t need to query for yourapp_id.