How can I use the mobileweb facebook connect API with phonegap?
Asked Answered
S

2

8

I'm trying to integrate Facebook into my Phonegap application that is going to be deployed for both Android and Blackberry devices. As there is only a plugin available for Android I need to go down the standard Facebook connect mobileweb route. However I cannot redirect back to file:// (Phonegap) so I'm wondering if anybody has come up with an alternative solution?

I was wondering if it was possible to redirect to a separate hosted site I setup that would store the access code and then get the Phonegap application to subsequently interrogate for the access code to then use with Facebook API calls?

Signature answered 30/9, 2011 at 8:41 Comment(2)
Can you show a code sample? I'm not understanding what the reasoning is for redirecting back to "file:// (Phonegap)"Hollow
Simon, did you check out this post? #4604774Yezd
P
0

Yes, you can.

Use the JavaScript API, enable "Website" and "Mobile Web" under your app settings at https://www.facebook.com/developers

You will need some sort of publicly accessible page available that you can put in your settings, but because you are using this app in a standalone manner, the site doesn't ever need to be used.

Also, have a "Login" button when using the JavaScript API. You might run into popup blocker issues if you programmatically try to open Facebook's login window.

Palmitate answered 16/11, 2011 at 18:33 Comment(0)
E
0

Can't you use the InAppBrowser of PhoneGap to call the Mobile Web auth stuff? See http://docs.phonegap.com/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser

To get started with Facebook Login, have a look here: https://developers.facebook.com/docs/facebook-login/getting-started-web/

Elman answered 13/9, 2013 at 7:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.