Just-in-time invocation of Facebook login window from UIWebView

Posted by Chris Garrett on Stack Overflow See other posts from Stack Overflow or by Chris Garrett
Published on 2010-04-29T12:42:41Z Indexed on 2010/04/29 12:47 UTC
Read the original article Hit count: 437

I have an app that presents a UIWebView pointing to my own server. I have a Facebook Like button on some pages inside the UIWebView.

I have it working now, but the login screen is way too big for the phone screen. I would like to present a nicer login dialog such as the one in the Facebook iPhone API, and then continue back to the web view.

The Facebook iPhone SDK has support for a login button and iPhone-friendly login screen, but it assumes that a user will click a login button before doing anything Facebook related. I would like the Like button to just appear, and to bring up the iPhone login screen only when necessary.

I have monitored HTTP requests from my web view, and it looks like I could intercept the login request there, and present the login dialog. However, it seems that this would be fragile, because if Facebook changes those calls then my app will no longer work. Is there a more elegant way to do this?

© Stack Overflow or respective owner

Related posts about iphone-sdk

Related posts about facebook