Take the 2-minute tour ×

I have a specific requirement: I have create a aspx page and designed it to be hosted as a facebook app. If I were to use this same page as host to muliple applications, this is the problem.

From what I've learned so far in all examples on the web, the app ID is hardcoded into the page. I want to load this dynamically based on which app is requesting it. I will then load the Javascript UI, and the rest of the page objects using the app_id i get.

How do I get this app_id from the url, say if the user uses: http://apps.facebook.com/CustomApplicationName (or) http://apps.facebook.com/1234567891

share|improve this question
This is quite an odd requirement. You can have multiple applications all pointing to the same base url and just put each app's code in separate sub-folders. - could you explain why this requirement is necessary? –  Lix Jan 12 '12 at 12:05

2 Answers 2

I do not think that you can get the APP_ID in this way.
What you could do is, instead of checking the APP_ID you could check the APP_NAMESPACE. APP_NAMESPACE's are also unique just like the APP_ID.

share|improve this answer
If I'm left with no other option, I'm going to have to do it that way only. I'm leaving the question open for sometime to see if there is a solution. –  Kunal Jan 12 '12 at 12:41

I finally found the answer: What I did was to add the appId as a query string parameter to the canvas URL, and than loaded the Javascript SDK dynamically on the canvas using this query string.

I'm currently facing a few problems in calling a function that checks FB.getLoginStatus as content. I'm unable to get the response object on debug. Not sure what's wrong.

share|improve this answer

Your Answer


