This operation is not supported in the environment this application is running on. "location.protocol" must be http, https, or chrome-extension and web storage must be enabled.
See original GitHub issueHi, I’m using cordova and followed firebase, firebaseUI tutorials like a bible. I successfully created the web part of the App which uses Google Auth / OAuth. I can also manipulate the User data from the browser.
The problem is when I build it via cordova build android
and install it on my android phone;
I get this error:
This operation is not supported in the environment this application is running on. “location.protocol” must be http, https, or chrome-extension and web storage must be enabled. Dismiss
I could not find any solution from google, my hair is almost gone and Auth is a must in my app. Cordova is using File (file://) protocol if I’m not mistaken. And I think, God-forbid, firebase does not like that protocol using any Authentication method. I also found out that firebase SDK just had an update 15 hours ago that has Auth updates. I updated to that version (4.1.2 to 4.1.3) but still, no luck.
Facebook and Google Sign In works in a Computer Browser and there’s no problem.
Is anybody experiencing or have solved this? Please enlighten me.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top GitHub Comments
You need to isolate the issue. Can you first render FirebaseUI without angular? Most of the times the issue is from something else. Also if you are building from scratch (new Cordova app), add the FirebaseUI and firebase.initializeApp() code in the www/js/index.js after
app.initialize();
Let me know if this helps.Here is my setup:
I’m calling that on my Angular controller just right after it initiallizes. Firebase is initialized properly as my console.log there returns null and user data on the computer browser.
Also, in the android build window.cordova returns an object document.URL.indexOf(‘http://’) returns -1 document.URL.indexOf(‘https://’) returns -1 document.URL.indexOf(‘file://’) returns 0
I found this issue that is I think identical to mine, but he did not state how he actually fixed his problem. https://stackoverflow.com/questions/44651423/oauth-signin-cordova-firebase