I am working on a page tab application and am having an issue with navigation. My application, written in MVC3, is displaying and authenticating just fine as a page tab. When I click on my tab, my app receives a POST with the signed_request object as expected.
My question is, how can I support links to other pages in my application? When a user clicks on a link, I want an action to be called in my application and to not leave the Facebook iframe. In addition, I need the signed_request to be passed along so I have a user context.
At first, I thought this was not supported and that all page tab applications had to be written as Single Page Applications. However, I found examples that do exactly what I am looking for.
Click on an image:
https://www.facebook.com/Sephora/app_305927716147259
And:
http://woobox.com/pinterest
How are these apps handling page navigation within the iframe?
The performance of clicking on an image seems to be pretty bad. What are they doing behind the scenes and is there a more direct way of handling navigation?
I will also need to handle POSTs.
Thank you.
When a user clicks on a link, I want an action to be called in my application and to not leave the Facebook iframe.
Well, that’s what normal HTML links do – so no extra effort required at this point :-)
In addition, I need the signed_request to be passed along so I have a user context.
You could pass it as a GET parameter with every link – but this way the user can easily “see” it, and it might also get transfered to external servers (if any external resources are embedded within your page) via the HTTP referrer.
The better solution IMHO is store the signed request server-side in your session (parsed already, if you like), so that you have access to it on the following pages of your app.
Related
I am trying to create a system which allows customers to add a Facebook page as an add-on to what our business offers. Ideally I want users to click a button from our site which creates a page for them on Facebook which contains an iFrame in which content is served by us from our site.
I've never done any work with Facebook before, I don't really understand how the whole app thing works (I don't really use it personally as well) and I'm not sure what the best way to achieve what we seek. I have read a few tutorials on the fb developer site, which were all completely out of date, but I created an app of type 'App on Facebook' that displays a canvas url with an iframe which displays some content.
However, what I really want is to do one of the following:
1) Create an app that can be added to someone's page, which takes a custom url and displays this url in the iframe on the canvas page.
For example, a user called bob initialises the facebook integration from our site, we automatically create a page for them, add the app we have created, and provide a url like http://ourcustomurl.com/bob which is a link to some content from our site which is then displayed in the iframe.
2) Another option I thought would be possible would be creating a new app for every user who enables the facebook integration from our site, and just setting the canvas url on creation. But this option doesn't sit well with me, we don't really want to create an app for people, but a page.
You can't create a Facebook Page or an App via the API
If i understand correctly you want page admins to install your app into a tab on their page, and have different content displayed on that page tab depending on which page it is.
Check this document: https://developers.facebook.com/docs/appsonfacebook/pagetabs/
The main takeaway you should have is that you can use the signed_request which is sent to your app to determine which Facebook Page the App is being loaded from and decide on your side which content to display based on that
I've had a hard time finding anything like what I'm trying to accomplish, seems as though FB updates their way of doing things every 6 months. The documentation I have found is hard to follow and I'm sure this can't be too hard. Here's what I'm trying to accomplish:
We operate a SaaS (in simple terms:) need to allow the user to provide a Form ID and return them a form via iFrame
Product management wants to be able to provide our customers with an app on Facebook where they would need to only add in their Form ID + Title, don't care about actual authentication with our product, just an ID to fetch.
The app would show up as a tab on their Facebook Page (and/or profile?) with the title of the tab showing what they entered and an iframe with the formId as the parameter to the source.. ie: the contents of that page tab would be a loaded iFrame: <iframe src="http://gotomyserver.com/fetch?FormId=123">
The idea is that our customers customers will see this form loaded up if they click on that tab on the page.
This doesn't seem like it should be overly complicated, however I'm having a lot of trouble finding information / understanding the documentation, or maybe I'm approaching it in the wrong manner?
Thanks
What you're trying to achieve is not possible at least because the same app can't have different titles depending on the page it is shown.
I would recommend you to make web application that serves the forms. Creating app everytime a user wants takes 5 minute. You will just need to insert in page tab url the corresponding address: http://gotomyserver.com/fetch?FormId=123 and set the title. Even your clients can do that by themselves.
Displaying an app to a facebook page takes an url copy/paste.
I'm attempting to develop my first Facebook app that is designed to allow clients of our website to sell tickets to their events from their Facebook page as well as from our website. So when the administrator of a Facebook page adds our app as a page tab, I need to be able to find out who they are so I can load the relevant event data. There also needs to be additional include/exclude configurations and various other options, which will affect the behaviour of the app.
So my question is how is this situation best handled? When playing around with a basic sandboxed app, I seem to be able to just add the app directly to a page; there is no prompt for configuration, and I can't see any way of defining custom properties.
Is the 'edit_url' property the only way to achieve this? If so, is there a way of automatically directing the page admin to this link upon initial use?
Decoding the signed request recieved in your page will give you more insight.
From this you can retrieve page admins' UID's.
You'll need to manage the rest on your side...
In order to get the user id the user will have to grant your application basic permissions.
I'm currently doing a somewhat similar app and, just like Lix said, I used the signed_request variable to detect the page where the tab is installed. Then, based on the page's ID, I retrieve the proper content.
To also give your users an admin page, add a Page Tab Edit URL in your app configuration where you can redirect your users to a custom panel where they can edit their app.
I'm not sure why but creating any kind of integration beyond the use of social widgets and buttons on external sites always confuses me.
What I need to do is create a tab on a particular Fan Page. This tab needs to:
Contain an interface for casting a vote in a Poll.
Handle multiple Polls. Only one will be featured in the tab at a time, but there should be an interface for navigating to previous polls.
All polling data needs to be stored on my servers - 3rd party Polling solutions (facebook apps, or embedable services) are not an option unless the data storage location is configurable.
All those requirements are pretty easy to address. Im just confused about how to integrate with FB.
Do i need full FB App for this, or is there another way? This will only be accessible via the Fan Page tab, so I don't necessarily need an App at apps.facebook.com.
If it is an app... is there a way to hide the app page, and the standalone app canvas from everyone except Fan Page admins?
FBML will be discountinue very soon. You might need to find an alternative way to do it. :-)
Check out the Static FBML app that Facebook provides. You can implement it on any Facebook fan page, change the tab title, and specify the content in HTML/FBML (with some limitations, I believe IFRAMES, password inputs, and some other random things are not allowed, but don't take my word on these until you test them). Hopefully this at least gives you a little head start.
Even Tradablebits platform is an option. They give a good functionality and make it simpler to work with Facebook. http://apps.tradablebits.com/ I analyzed this platform for one of my apps.
Per the new profile/fan page tab rule that eliminates the iFrame option, is there a way to dynamically generate content for a given tab? I've seen methods that wrap a canvas app (but requires a user to click to load content), but I want to show updated content thats managed on my servers. I thought you could also update the FBML using the Graph API, but haven't been able to find anything on that.
You can display static FBML on Application Tabs which is dynamically generated, you just can't auto-load anything that's dynamic on the client side (until the user clicks something)
You'll need to make sure you setup the application to be installable to pages as well.
Go here for help on all things social media, especially FBML.
www.facebook.com/fanpagefactory
ask questions to the community or in the 24/7 live chat (you will get a timely response either way)
Enjoy.