3

Gurus of SO

I have a working web app which works well enough with Facebook Connect. But when I post the Web App to the Home Screen on iOS 4.3.4 & click on 'FB Login' in the app -> it triggers Safari to open up and I end up leaving the Home Screen view.

Is there anyway to login from the Home Screen app itself and not trigger Safari?

Thank you.

iUsable
  • 361
  • 3
  • 13

2 Answers2

3

Tried target="_webapp", target="_blank", etc none of those worked for me.

This bit of javascript worked just fine for me:

<a href="#" onclick="window.open('<put your facebook login URL here>','_parent'); ...
bmac
  • 76
  • 2
  • Doing this means I can't use the javascript API directly? I have to parse the return url for information? Any example of tying this into the FB javascript API? – fancy Nov 09 '11 at 14:13
  • i don't know how or why this works but I am SO happy it does. Thank you sir! – Mike Silvis Jan 28 '13 at 00:25
1

It is doing this to verify the Facebook login session. Currently, you cannot avoid this since your web app must go to Facebook dialog anyway to have the user login if they haven't already.

Dhiren Patel
  • 645
  • 4
  • 6
  • I figured it out, it is possible by a tiny JS trick to open links in the same window. – iUsable Sep 11 '11 at 22:04
  • Oh, I see. I understood your question as asking if it was possible to avoid the redirect in the first place. If doing it on the same window works, then I think you're fine. Glad you got the workaround. Perhaps you can post your workaround here so other folks can benefit. – Dhiren Patel Sep 11 '11 at 22:49
  • iUsable: I'm interested to know what the "tiny JS trick" was? Thanks in advance! – tkahn Dec 22 '11 at 14:44