OAuth Facebook Login to Phonegap returns InvalidHeader error

I am developing an application using Phonegap and it implements Facebook login to save some data using user_id as a link. I use the OAuth.io library to implement the login dialog and everything runs smoothly in the web browser and on Android, but when I test the application in Xcode and I press the login button, the following error appears.

Cannot find host name in file: /// from static
code: InvalidHeader
message: Cannot find host name in file: /// from static

I assume that this is due to the fact that the telephone delay does not make an external request, since the application is not actually located in the domain, but works locally ... any thoughts?

+3
source share
3 answers

It looks like you are using the oauth.js library instead of the telephone version. On the main page "index.html" add a link to the correct js file

<script src="oauth-phonegap.js"></script>

Then follow the instructions here to create your application.

+1
source

oauth.io. , Ajax REQUEST Facebook ( ). Wether , REQUEST Facebook , , . , , oauth .

0

Phonegap 2 . facebook, OAuth.I .

-, , OAuth. OAuth 2.0 - -.

-, : , uid, expires_time. - .

-, . 2010 , Phonegap Childbrowser ( Phonegap inAppBrowser) .

? OAuth .

1: script , OAuth Service (facebook).

2: OAuth (Facebook) Facebook.

3: OAuth Service (Facebook) URL- .

4: , OAuth Service (Facebook), .

When I saw "I can’t find the host name in the file: /// from static" in your description, I know that maybe you get confused in OAuth.Now, I offer you some server-side code to process it and make your OAuth process possible.

0
source

All Articles