Get the Facebook iOS SDK to talk to your server
Aug 24, 2011
Dick Brouwer
1 minute read

The new Facebook iOS SDK pushes the concept of Single Sign On (SSO) on your iPhone. It has some disadvantages (fast-app switch to FB app or Safari to authenticate), but you don’t have to enter your username/passwd anymore if you are logged into FB on another app.

This is nice and all if you use the SDK to communicate directly with Facebook to make requests. In many cases though you will have your iPhone talk to your backend server, which in turn will make requests to FB.

One of the quirks with this new SDK, is that the access token it uses is different from the access token generated by the server-side flow or Javascript SDK (due to the extra sdk_version=2 and sdk=ios params in each request). It seems that this access token is incompatible with the server-side flow if you use the (original) Python SDK.

Now, you actually can use this new/longer access token, but urllib chokes. If you update the Python SDK to use urllib2 to fetch GraphAPI requests, it works fine.

comments powered by Disqus