I am trying google signin using AngularFire2. Google authentication is working perfectly when I use this.afAuth.auth.signInWithPopup. But signInWithPopup is only for browser and wont work for mobile app. As per google documentation, signInWithRedirect should be used for app. I tried using method but it is opening browser for signin.
Instead I tried using cordova google plus plugin to signin, and using the accessToken to authenticate Firebase.
When I try to call login method of cordova plugin, it is throwing error, and error has only '17' number.
I have following questions
- Is there anything I am missing?
- What is the better way to sign in ionic mobile app using google plus?
- what is the meaning of error '17'?
Here is my code
this.gPlus.login({
webClientId: '<myClientID>',
offline: true
})
.then(res => {
this.afAuth.auth.signInWithCredential(res.accessToken);
}, (err) => {
console.log(err) // Logging 17 here.
})
.catch(err => {
console.log(err);
})