同时在 iOS 和 Android 上设置 Google Auth Atlas Mongo Realm

问题描述 投票:0回答:0

我在 Android 和 iOS 上有一个多平台应用程序。

目前不可能让谷歌登录机器人 iOS 应用程序和 Android 应用程序,对吗?

在文档中,如果我们添加客户端 Web 应用程序配置,iOS 应用程序应该可以运行,但事实并非如此。 https://www.mongodb.com/docs/atlas/app-services/authentication/google/#std-label-auth-google-configuration

这有什么解决方法吗?

这里报告了同样的问题:

https://github.com/realm/realm-swift/issues/8111

https://github.com/realm/realm-swift/issues/7506

我登录谷歌的方式是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

共享仓库上的方法:

suspend fun signInWithGoogleLogin(googleUserIDToken: String): User {

        val credentials = Credentials.google(googleUserIDToken, GoogleAuthType.ID_TOKEN)

        return appService.login(credentials)
    }

是的,我确实在应用程序服务上为 OAuth Web 添加了客户端 ID 和客户端密码。

mongodb realm mongodb-atlas kotlin-multiplatform realm-mobile-platform
© www.soinside.com 2019 - 2024. All rights reserved.