I have a multiplatform app on android and iOS.
At the moment is not possible to have google sign in working for bot iOS app and Android app, right?
On the documentation, it is stated that the iOS app should work if we add the client web application configuration, but this is not true.https://www.mongodb.com/docs/atlas/app-services/authentication/google/#std-label-auth-google-configuration
Is there any workaround for this?
Same issue reported here:
https://github.com/realm/realm-swift/issues/8111
https://github.com/realm/realm-swift/issues/7506
The way that I do the google login is swiftui:
func handleSignInButton() { GIDSignIn.sharedInstance.signIn(withPresenting: getRootViewController()) {signInResult, error in guard let result = signInResult else { // Inspect error return } self.repo.signInWithGoogleLogin(googleUserIDToken: result.user.idToken!.tokenString){user, error in
The method on the shared repo:
suspend fun signInWithGoogleLogin(googleUserIDToken: String): User { val credentials = Credentials.google(googleUserIDToken, GoogleAuthType.ID_TOKEN) return appService.login(credentials) }
And yes, I did add the client id and client secret for the OAuth web on app services.