I am having a lot of trouble figuring out how to implement Facebook Oauth for mobile web applications. I would like to use the “touch” interface as indicated in the “display” parameter in the following code example on their developer website. Does anyone have experience using this code? I can’t seem to get it working in Javascript. Are there other ways of using getting my users to see the touch enable login interface?
Here is the documentation that I am referring to: http://developers.facebook.com/docs/guides/mobile/
Yes, there is a way to enable your mobile browser users to see the touch-enabled login interface. Instead of using the FB SDK, you need need to use the
oauthmethod as described here:http://developers.facebook.com/docs/authentication/
I’m using the ‘Server Side Flow’ to do exactly what you’re trying to do and it seems to work great.
First you redirect to the FB oauth page, passing your app ID and your landing page as a callback (NOTE: landing_page MUST be formatted as a directory and cannot be a document!). Pass in
display=touchand optional app data if you need it usingstate.After the user logs in successfully, your user will be redirected to landing_page with a
GETvariable ofcode. You can use thiscodeto get anaccess_tokenif you need to query the Open Graph API for user info like this (in PHP):