更新Google登录

This commit is contained in:
2024-12-01 21:27:39 +08:00
parent 784427cfba
commit cc7a65e016
9 changed files with 147 additions and 73 deletions

View File

@@ -22,10 +22,10 @@ fun handleGoogleSignIn(result: GetCredentialResponse, onLoginWithGoogle: (String
}
}
suspend fun GoogleLogin(context: Context, onLoginWithGoogle: (String) -> Unit) {
suspend fun GoogleLogin(context: Context,clientId:String, onLoginWithGoogle: (String) -> Unit) {
val credentialManager = CredentialManager.create(context)
val googleIdOption: GetGoogleIdOption = GetGoogleIdOption.Builder()
.setServerClientId("987156664714-3bpf58ldhhr0m474ep48l668ngdn7860.apps.googleusercontent.com")
.setServerClientId(clientId)
.setFilterByAuthorizedAccounts(false)
.build()
val request = GetCredentialRequest.Builder().addCredentialOption(googleIdOption)