angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Ionic 3 error to try to authenticate with Google or Facebook

Open ivanhdzd opened this issue 9 years ago • 5 comments

Hi, I´m creating an Ionic 3 App with Angularfire2, and it has some problems when I compile it in an Android device and I try to login by Google or Facebook, the last week it works all right, but I do some tests today and it launch some environment errors.

Version info

Angular: 4.1.3

Firebase: 4.3.0

AngularFire: 4.0.0-rc.2

Cordova: 7.0.1

Ionic: 3.9.2

Also add promise-polyfill 6.0.2, because I show it in docs/Auth-with-Ionic3-Angular4 and Authentication instructions with Cordova an Firebase.

How to reproduce these conditions

When app is running on Android device, it can login by email and password, but it launch an error when I try to login by Google or Facebook:

{
    code: "auth/operation-not-supported-in-this-environment",
    message: "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."
}

My authentication code is:

  • AuthProvider:
constructor(private angularFireAuth: AngularFireAuth) { }

public SignInWithGoogle(): firebase.Promise<any> {
	let provider = new firebase.auth.GoogleAuthProvider();

	return this.angularFireAuth.auth.signInWithPopup(provider)
		.then(res => console.info(res))
		.catch(err => console.error(err));
}

public SignInWithFacebook(): firebase.Promise<any> {
	let provider = new firebase.auth.FacebookAuthProvider();

	return this.angularFireAuth.auth.signInWithPopup(provider)
		.then(res => console.info(res))
		.catch(err => console.error(err));
}

The last week it works all right.

ivanhdzd avatar Sep 07 '17 22:09 ivanhdzd

@ivanhdzd Can you reproduce the error with a simplified version of your code containing nothing but the instructions in the community guide? If so, we might be able to take a look. If not, this is probably outside the scope of what we can help debug, given there's no minimal repro here.

katowulf avatar Sep 11 '17 18:09 katowulf

@katowulf why has been the issue closed? @ivanhdzd do you solve the problem?

emmeci92 avatar Oct 06 '17 10:10 emmeci92

@Wanted92 I had to downgrade Angularfire2 to 4.0.0-rc.1: [npm install --save-exact | yarn add --exact] [email protected]

ivanhdzd avatar Oct 09 '17 17:10 ivanhdzd

I am facing same issue

nyousaf47 avatar Dec 05 '17 12:12 nyousaf47

Facing the same issue "angularfire2": "^5.0.0-rc.7.0-next",

OAnouman avatar Apr 28 '18 17:04 OAnouman