I implemented a Facebook login and it is working, but I cannot get google sign-in to work.
I added the sha-1 key into my firebase project.
When I am trying to login on my browser (with ionic serve) without the GooglePlus plugin it works. This is the code:
var provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithPopup(provider).then(suc=>{
console.log(suc);
}).catch(err=>{
console.log(err);
});
How can I fix this error?
Thank you for your help!
var provider = firebase.auth.GoogleAuthProvider.credential(res.idToken);
where I am taking the response from the ionic native plugin’s callback. This was for Android, iOS was:
var provider = firebase.auth.GoogleAuthProvider.credential(res.id_token, res.accessToken);
with Android you may have “offline” set to true passed in with the webClientId, everything should work so long as the webClientId and SHA were defined correctly.
Hey, I wrote a tutorial about it a couple of days ago, you can find it here.
Basically you need to go through the entire google flow and then pass the credential to Firebase, with .signInWithCredential() you can’t use the pop-up methods in your phone through Ionic.
For the SHA-1 of the keystore fingerprint, you need 2, one for development and one for production, the article goes over it a bit more in-depth.
From what I have read it is related to the Android keystore (e.g. debug.keystore) not matching the one in your Google API Credentials. However, mine are matching and I still get the error.
I just met with this issue and its’ all about your SHA1 mis match … The best I did is to delete the key and generate a new one again… But this time, when you pick OAuth , try to pick it for Android and generate the key. It should work now… This is applicable when you have Google Plus ionic-native plugin running to support the native functions of Google Plus login with an account pop up. Hope this answer helps someone !
Hi, do you delete the debug key or release key? if you delete the debug key how do you that? And how tell to the app that the new debug release key is the new that you has created