Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OAuth Facebook Login in Phonegap returns InvalidHeader error

I'm developing an app using Phonegap and it implements a Facebook login to save some data using the user_id as a reference. I'm using OAuth.io library to implement the login dialog and everything runs smoothly in the web browser and in Android but when I test the app in XCode and I tap the login button the following error appears.

Cannot find hostname in file:/// from static
code: InvalidHeader
message: Cannot find hostname in file:/// from static

My guess is that it has something to do with phonegap not making an external request since the app is not actually hosted in a domain but running locally... any thoughts?

like image 789
JohnFalcon Avatar asked Dec 02 '25 01:12

JohnFalcon


1 Answers

Seems like you are using oauth.js library instead of phonegap version In your main page "index.html" add reference to the correct js file

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

Then follow the instructions here to build your application

like image 93
Islam El-Khayat Avatar answered Dec 03 '25 17:12

Islam El-Khayat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!