3

I'm writing a PhoneGap based application for iOS 5. And I faced up with the following problem:

I use Facebook for login. After successful authentication, user should be returned to my application. Everything works ok except one thing - url that is returned from Facebook with http 301(redirect) is opened in a new safari window instead of PhoneGap's webView.

I'm confused because usually I need to write some extra code to force PhoneGap app open URL's in Safari. And now I have a vice versa situation.

Is there any workaround to avoid such behavior?

I'm using OS X 10.6.8, Xcode 4.2, PhoneGap 1.2.0.

  • I have found a working solution in this thread http://stackoverflow.com/questions/8171983/what-controls-whether-phonegap-opens-an-external-browser-safari – Anthony Nov 25 '11 at 15:34

1 Answers1

0

If you are writing a PhoneGap app, then your web app is a client-side web app - i.e. it runs on file:// protocol. For Facebook Sign-on to work, it would need work with a client-side web app, or website on http(s) protocol. That's what you registered when you create a new app on Facebook Developers website.

In order for Facebook to work with a client-side app, whether in Java/C/Obj-C or Javascript, you need to do a 2-legged OAuth authorization. It's not a common thing to do so you might need to google harder.

timdream
  • 5,914
  • 5
  • 21
  • 24