Articles tagged 'facebook'

Blog Projects

Facebook POST for Canvas fix

Latest usage and examples can be found from Rack::Facebook::MethodFix project page.

In early 2011 Facebook started to send all iframe application requests as POST. Because of this most REST based applications broke. Lets say you have object called User. To get list of users in RESTful application you would issue the following request:

GET /users/

New user is created with POST request:

POST /users/

I’m sure you can spot the problem here. You try to retrieve list of users. That does not work. Instead you end up creating new object because your request was converted to POST.

Continue reading >>

How To Make Facebook iFrame Tab Higher Than 800 Pixels?

One of the best things to happen in Facebook development lately was to enable iframe application tabs. This was widely welcomed by developers. However many blog posts wrongly assumed there was a 800 pixel limit on the tab height. Behold, here is the 5000 pixel tab.

Continue reading >>

Ajax Fails After Facebook.showPermissionDialog()

Facebook developing is pretty much trial and error. Documentation has lately been improving a lot. Still there are lot of surprises. Especially with FBJS. Recently I got stuck with a problem of Ajax requests sometimes silently failing. Developer forums and Stack Overflow had the same problem but no answer.

Failing FBJS Code

First user clicks a submit button in application tab. Code will then show dialog requesting for extra permissions.

After giving the permissions code should submit form data to server. I also wanted to to receive the uid of current user. Hence the parameter ajax.requireLogin is set to true.

Continue reading >>

Rake Tasks For Easier Facebook Development

Lets face it. Facebook development is tedious. You do not want to waste more time in endless commit-push-pull-restart loop for smallest code changes. Common development setup is to tunnel traffic from development server to your laptop using ssh tunnel. Here are my Rake tasks for switching between production and development mode.

Facebook Application Stack

I use Sinatra, Thin, Sinbook and DataMapper for all my Facebook development. All static assets are served by Apache. Apache also proxies other requests to Sinatra using mod_rewrite. Proxying is easiest to setup using the following rule in .htaccess file:

  RewriteEngine On
  RewriteBase /

  # Everything not found goes to Sinatra / Rack
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule (.*){REQUEST_URI} [L,P,QSA]

Continue reading >>

Built using the awesome Flat UI Pro framework by Designmodo.

© 2013 Mika Tuupola.