6
votes

I developing a hybrid mobile application using Cordova + Angular 2 + Ionic 2.

When using firebase Auth, when calling signInWithPopup() or signInWithRedirect() for social logins, firebase returns error "This operation is not supported in the environment this application is running on. "location.protocol" must be http or https."

There's also a number of comments on this article, about same thing: https://firebase.googleblog.com/2016/01/social-login-with-ionic_77.html

This is because the location.protocol is file:// and NOT http/s. All hybrid apps will have this issue.

Help.

1
Check out the workaround here stackoverflow.com/a/37439461/6523173looptheloop88
@FrankvanPuffelen is anything being done internally to resolve this? I haven't seen any updated from Google devs thus farMark
I have spoken with Firebase support too. They are kind, but very unclear on if/when they will be fixing this issue. It leads me to think that it is time to look for alternatives to Firebase.Dan
same error with ionic 2.2 and firebase v3Diego Borges

1 Answers

0
votes

It won't work

Explanation: You are trying to connect your hybrid application to firebase using firebase web SDK, so firebase is not allowing to connect.

web SDK is allowed for only HTTP and https based applications

So to connect, use mobile app SDK(there is separate SDK for android and IOS)

If you are using expo to build your application, the recommended way is to use the signInWith UserName and password.

Advanced solution: you need to change the babel config correspondingly