I use google Sign-in OAuth2 for my android app, and config step by step project like the google doc, and create Client id for android(release and debug version) and web application and everything is okay.
But sometimes it does not work and somtimes it works good, when it does not work i get error code 10, and I can't understand what is wrong.
my code:
private fun checkGoogle(){
val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.server_client_id))
.requestEmail().build()
mGoogleSignInClient = GoogleSignIn.getClient(getParentActivity(), gso)
val account = GoogleSignIn.getLastSignedInAccount(requireContext())
if (account != null) {
mGoogleSignInClient?.signOut()
}
}
I use google Sign-in OAuth2 for my android app, and config step by step project like the google doc, and create Client id for android(release and debug version) and web application and everything is okay. But sometimes it does not work and somtimes it works good, when it does not work i get error code 10, and I can't understand what is wrong.
my code:
I use
implementation("com.google.android.gms:play-services-auth:15.0.0")