I've been developing a google sign in functionality in ionic with this plugin: https://github.com/EddyVerbruggen/cordova-plugin-googleplus
It has been a painful journey already. I got it working on android now. I ask the plugin to pass me an idToken, but in order to retrieve it you need to pass the webClientId with it (as shown in the code below). From android and ios I retrieve that said idToken and send it to the back end to check if it's a real token. Now here's the part I don't really understand. On android, the verification passes and logs the user in, but on ios if gives me the error wrong recipient, payload audience != requiredAudience
The code is exactly the same so I don't really understand what is happening here. Any people got any experience with this and the plugin that can help me out? Thanks a million in advance. Here's the code if that could help anybody:
googleLogin() {
this.isLoggingIn = true;
this.googlePlus.login({
'webClientId': environment.webClientId
}).then(googleRes => {
this.authService.googleLogin(googleRes.idToken).subscribe(
//logic
)
}).catch(err => {
console.log(err);
this.isLoggingIn = false;
});
}