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

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?

Related

Focus Facebook tab from browser notification triggered from canvas app / iframe

I have an facebook canvas app that loads in an iframe on facebook, and I want to be able to focus the facebook tab in the browser from my code.
My app shows native browser notifications through the browser's Notification API (not facebook notifications), and I would like to focus the Facebook tab (within which my app loaded) when the user clicks the browser notification that my app shows.
If my app is loaded outside of facebook in a tab by itself (not in an iframe), then I can just use window.focus() to refocus the tab; hoever, when loaded in facebook, because of the iframe, window.focus() doesn't focus the tab, and because of cross-site origin, I don't think I can access the parent facebook window context to give it focus.
What solutions or workarounds might there be? I didn't find any functionality exposed by facebook api (eg. something like FB.Canvas.focus())

Proper Facebook login for website

I want to allow people to log onto our website using their Facebook account. I noticed that when I click the login we added, the window opens displaying a detailed message and has a button which says Play Game.
On other sites I've seen a pretty simple window such as on CNet with a Cancel and Okay button on the bottom.
Did I setup something incorrectly on Facebook that is causing mine to be more complex?

Facebook app POST displays blank page

I'm programming a Facebook app on localhost. When some event triggers, the user gets a notification on Facebook. The notification works great, but however when he opens it, it sends a POST request to:
http://localhost:5939/Home/Messages/20
and displays like this in the browser:
https://apps.facebook.com/{FACEBOOK-APP-ID}/Home/Messages/20?fb_source=notification&ref=notif&notif_t=app_notification
If the user is located outside the app on Facebook (but on Facebook), the app loads correctly. If the user refreshes the page while in the app, it displays correctly. However when the user is located INSIDE the app and clicks the notification, it displays a white blank page.
What could be causing this?
I'm using ASP.NET MVC 4 .NET framework 4.5 and yes, my Messages controller function is POST.
I got this fixed by changing the apps Namespace to something other than blank. Now it works.

Facebook iOS SDK - UIWebView dialog for login - how can user manually cancel?

I'm having a problem here. I've modified a portion of the source code to prevent my app from launching the Facebook app or Safari for authentication. Instead, a UIWebView will be displayed as an overlay on my app.
However, in the dialog. I noticed there isn't any CANCEL button. Which makes me wonder what happens if the user decides not to login.
I had forgotten to copy the FBDialog.bundle over to my project! ahh!
Are you using FB graph API for facebook login.? If yes,
Then the view that you see for login is programmatically created.
Look into the FBGraph.m for its implementation.
There you can add a cancel button and add your cancel logic there.

How to make facebook like button shows a mobile-optimized Facebook login page?

I have a mobile website designed to be shown in a iPhone app.
There is a Facebook like button in that mobile web.
If the user click the like button without logging in, the button will show a full-facebook login page, which looks like a disaster in mobile phone! Is there a way to configure the like button so that it shows a mobile optimized login page?
picture:ugly facebook full-login-page in mobile web
p/s: in case you are curious, I do not have access to the iPhone app source code so showing native facebook login etc is not an option for me. I can only design the webpages that lives in the UIWebview in an iPhone.
In this case, Facebook should show a mobile optimized login screen. Please raise a bug at developers.facebook.com/bugs with steps to reproduce this.