AngularFire2-Ionic2-Facebook
AngularFire2-Ionic2-Facebook copied to clipboard
Internal error when applay to use google
Hi, I'm seeing how to login with facebook and then I apply this with google too.
I run on android when
this.auth.login(creditial, config)
I got internal error Can you help me?
Are you trying to log in from iOS, Android or Web (Ionic serve) ? Which error you've got ?
Yes , I execute this command " ionic run android -l " and then login I got this Firebase failure: {"code":"auth/internal-error","message":"An internal error has occurred."}
Yes, I see.
By default angularfire2 external providers login method is not yet compatible with ionic2 cordova, the purpose of this repo is to enable the facebook login through cordova with a method that invokes cordova-plugin-facebook4, as far as I know there's no equivalent for google login at this point. I've tried to install the cordova-plugin-inappbrowser but is not triggered by angularfire2 for now. They'll probably update this very soon.
Your best bet now if you want to enable google provider is to use : https://github.com/nraboy/ng2-cordova-oauth
But I haven't tried it yet, but I'll definitely give it a go in a couple of hours.
Any updates? Same error trying to do
GooglePlus.login({
'webClientId': '--XXt.com',
'offline': true
})
.then((a) => {
console.log(a.serverAuthCode);
console.log(a.idToken);
console.log(a.email);
console.log(a.userId);
let credentials = firebase.auth.GoogleAuthProvider.credential(a.serverAuthCode);
this.af.auth.login(credentials, {
'method': AuthMethods.OAuthToken,
'provider': AuthProviders.Google,
})
.then((success) => {
console.log("Firebase success: " + JSON.stringify(success));
alert(JSON.stringify(success))
})
.catch((error) => {
console.log("Firebase failure: " + JSON.stringify(error));
alert(JSON.stringify(error))
});