I am developing a facebook fbml app on google app engine using pyfacebook library. I was facing a weird problem. If the user was accessing the app for the first time, I used to redirect him to the application installation page and facebook used to say installation url is invalid. But, if the same redirected url was copy pasted in browser’s window, it used to take the user to the installation page. Weird.
The following was my code to do this:
if fb.check_session(self.request) and fb.added: pass else: url = fb.get_add_url() self.redirect(url)
I tried searching in google and facebook forums for this issue but came up with zilch. So, as a work around, I figured out this quick hack:
template_values = {} if fb.check_session(self.request) and fb.added: pass else: template_values['installation_url'] = fb.get_add_url()
Relevant fbml code:
<fb:if-user-has-added-app> This is my app. <fb:else> <fb:redirect url="{{installation_url}}" /> </fb:else> </fb:if-user-has-added-app>
What I am doing here is, first I am checking if the user has already added the app. If so, display the app, else, redirect him to the app installation page.
This is a dirty hack but, until I figure out what was wrong with the original one this will have to do :(.
Hack
Group
There is a special aspect in Facebook called office networks.
When starting out, he had benefitted from the
financial and advisory support given by his father-in-law, but, subsequently,
he went against his father-in-law advise by venturing into other restaurant
businesses which were highly successful and are now contributing about two
thirds of the business turnovers. He was so
confident that the hacker was no very good and chatted with me to make positive I do not contact Pay –
Pal.
Wonderful blog! Do you have any tips for aspiring writers?
I’m hoping to start my own site soon but I’m a little lost on everything.
Would you advise starting with a free platform like WordPress or go
for a paid option? There are so many choices out there
that I’m completely overwhelmed .. Any ideas? Kudos!