views:

42

answers:

1

Hi,

I'm building a custom CMS for my clients and i've implemented the Facebook API for posting on Page Walls as admin. All works well but I do have one question. Let's say the FB app name is 'CMS FB APP'.

The CMS will reside on my clients' servers, is it possible to use 'CMS FB APP' for all of my clients? Or do I have to create an application for each CMS that I install on every different server?

In the app settings I have to set a Site URL and Site Domain but this is for each client different, I don't seem to find a solution for this problem.

Thanks for your respond

Regards

+1  A: 

If you are using authentication, you have to create a separate app for each url where your app will be hosted. You will receive an error when the user tries to log in with facebook. Facebook requires that your 'next' and 'cancel' urls in the authentication return urls be on the same domain as your app's Site Url. One solution would be to setup an app with a base url such as example.com and have each client on their own subdomain like client1.example.com, client2.example.com, etc. Short of that, you are stuck making separate apps.

Nathan Totten
Or I could host the Facebook api on my own server (or subdomain) set the base Url of the Facebook app to that URL and use cUrl to post messages? That could work, I think..
Bundy
Posting messages won't be an issue. As long as you have a valid auth token you can make api calls from anywhere. The only issue with the domain is the initial authentication.
Nathan Totten
Ok, I think I fixed it. The return URL is set to a page on a subdomain on the main site domain set by the Facebook app. Then there's a link with session key and auth token that redirects the user to the CMS. That seems to work nicely :)
Bundy