"errorMessage":"The operation couldn’t be completed. (com.google.GIDSignIn error -8.)"}
When i run my app in iOS in both of real device and simulator, Google authentication dialog is opened correctly and input my google account then submit. Google authentication is closed and I got the error below in console.
"errorMessage":"The operation couldn’t be completed. (com.google.GIDSignIn error -8.)"}
I use "@codetrix-studio/capacitor-google-auth": "^3.2.2". All settings seem to be correct.
my code is below
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
…
async handleSignInClick() {
let googleUser = await GoogleAuth.signIn();
console.log('googleUser', googleUser);
…
Do you know why the error occur? This is my environment
Ionic:
Ionic CLI : 6.20.8
Ionic Framework : @ionic/angular 6.5.3
@angular-devkit/build-angular : 15.1.4
@angular-devkit/schematics : 15.1.4
@angular/cli : 15.1.4
@ionic/angular-toolkit : 6.1.0
Capacitor:
Capacitor CLI : 4.6.2
@capacitor/android : 4.6.2
@capacitor/core : 4.6.2
@capacitor/ios : 4.6.2
Utility:
cordova-res : 0.15.4
native-run : 1.7.1
System:
NodeJS : v18.12.1
npm : 8.19.2
OS : macOS
Thanks
After I re-build project without firebase, it works! Thanks.
I found how to reproduce this problem. When I specify https://www.googleapis.com/auth/calendar or https://www.googleapis.com/auth/drive in scope. It works at first time. But after sign out then try to sign in, this error occur in iOS.
"errorMessage":"The operation couldn’t be completed. (com.google.GIDSignIn error -8.)"}
After I disconnect my google app from my account https://myaccount.google.com/permissions?continue=https%3A%2F%2Fmyaccount.google.com%2Fsecurity Then try to sign in, it works.
This problem seems to occur when I have already passed permissions to the designated scope on my Google account on the second and subsequent logins.
I am currently using a quick workaround for this whereby if I detect the error is -8, I will use the refresh flow
GoogleAuth.refresh()
This will enable me to get the authenticationToken and the refreshToken of the user that is currently being signed in
Any progress on this issue ?
Same issue here
Any update on this?
I have the same issue in iOS With the same code, Android works fine, it is just the problem in iOS I am using the suggestion by @AlvinTCH . When I got the GIDSignIn error -8 message, I will try the refresh flow. If the refresh flow still have the problem, then I will throw the exception.
Using this logic, it works fine in my iOS app now