User-defined settings for Facebook page tab? - facebook

I am developing a Facebook iframe application that requires some configuration for each install, such as long/lat and some third-party API keys. I would rather not have to create a new app for each implementation.
Is there any way to allow the user (page owner) to define these settings? Ideally, I'd like to provide additional settings in the "Edit Settings" dialog on the apps admin page (currently the only setting is "Custom Tab Name").
Thanks!

It is possible, but there is no easy/standard way to do this. I would try the following:
Your backend would need to provide the storage for each tab's settings; these would associate a specific tab with a specific page.
In your application's tab iframe add a link that only shows if the user viewing the tab is the user who is associated with the tab. You can do this by looking for the page value in the signed_request and making sure that the user is an admin.
When the user clicks that link, pop up the dialog to let them feed in the custom settings and save that on the server after performing the relevant validation.
On subsequent loads of the tab, look up and use the saved settings appropriately on your server.
You'll need to do some handling for situations where the page settings haven't yet been created, but that SHOULD do what you want.

Related

Facebook page form

I am trying to create a form that will pop up over the top of a facebook page (not profile) when a user clicks onto that page, if the owner of the page has a specific app installed.
The popup would require the user to dismiss the popup/complete the form before they could interact with the page.
Apparently this used to be possible, does anyone know how to go about doing this now?
I suspect what I am after is a custom dialog that can be triggered on page load. Is such a thing possible in facebook?
This will not be possible. Facebook Pages no longer have what were called "Default Landing tabs" which would direct non-fan users to a particular tab app. Even then, this kind of popup behaviour would probably have been undesirable for users, possibly prohibited by Platform policy and likely blocked by most users browsers.
You can still create a Page tab app that can be gated behind any kind of restriction that you wish, however the regular Page content will still be visible to any user.

How do I test a Facebook page tab app without creating a public page for it?

I'm developing a FB page tab app, and I want to provide my client a URL for testing the app. I don't have a page specifically for this app, nor do I want to create one - the test versions of the app should remain private. What is the normal process for testing page tab apps privately in this manner?
Try this:
Go to your application: developers.facebook.com/apps
open your app, on left side there is a section called advanced (settings->advanced),
just click on that and you will find create a facebook page option,
you can create a facebook page and after creating,
you can set setting for publish or unpublish.
You have to enable the Sandbox Mode in your app settings.
If you want to give other users access to the app, you need to add them as developers or testers in the Roles settings.

Is it possible to enforce initial configuration of a page app?

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.

Do I need to create a new Facebook app for each app tab on a page?

I recently made an app so i could have an iframe tab on my page. i want to add another tab with an iframe. Can this be done with the same app?
Can i determine which tab a request came from? Its going to be different content under each tab.
I want to keep it the same app so users will not have to grant permissions for a second app.
No, you can only define one tab per app. You can configure that tab to display different content for different pages, but you cannot install more than one tab to a page using the same app. You'll have to create multiple apps, but you should be able to point them at the same codebase and determine which app is requesting content to serve the proper tab.
Regarding permissions, I'd work it so that you don't do any authentication from the tab itself but instead you link them to the same installation endpoint.

How do I get a Facebook app I've created to show up on a Facebook "Page"?

I have successfully created a Facebook application. I have successfully added the application to my Facebook "Page". After I do this, no link for the app shows up in the menu on the left. This seems like something that should be simple to do, yet I can't find any documentation that is up-to-date. Any help is greatly appreciated.
Configure the Page Tab settings in your application settings under Facebook Integration.
Go to the developer page where you get the list of your apps.
Click on the more link next to your app, and choose Application profile.
Once you are on the app profile, on the sidebar menu click on Add to my page and choose the page where you want to add the tab.
Note that you must have your app tab configured properly inside your app configuration in order to get this to work i.e. setting the correct domain and tab file.
If you are logged in as the page, I suggest you either creating a profile ID and log in as it, or the solution that #ifaour pointed out, although it will be difficult to find your app inside the search engine that FB provides.