Search code examples
cordovafirebasefirebase-authenticationphonegap-pluginsphonegap

Phonegap, firebase authentication "a network error has occured"


I'm very new to Phonegap, so for all I know this is a really simple fix...

I essentially just copied all my files from my website into the www directory, and added an index.html to it. I also found the cordova.js file in the platforms folder and copied it to my www.

When I click on the ip address in my browser, everything works perfectly. Firebase is able to connect and auth the user etc, but when I do so on the iPhone using the phonegap app, I get an error:

A network (such as timeout, interrupted connection or unreachable host) has occured.

I only get this after tapping the button several times (out of frustration), when I just press it once, nothing happens, unless the textfields are empty in which case it returns the typical frontend errors...

I'm not sure what to do.. Anyone have this problem before? How do you solve it?

Edit: Here is a pastebin of the server log.. It's quite long, and I don't know if there is any useful information in it.. https://pastebin.com/9HUJm8wP


Solution

  • Took me a while to figure out, but it turns on Firebase has official documentation on getting this problem fixed: https://firebase.google.com/docs/auth/web/cordova.

    It ended up being super straight-forward.