The code linked on Drive is close, but not quite correct. You have mixed up the resultCode and responseCode. You should check result.resultCode == Activity.RESULT_OK not result.resultCode == 100 in your callback for registerForActivityResult.
With the old startActivityForResult(intent,code) flow you would launch the activity with an integer code (e.g. 100), then check for that code in onActivityResult to make sure you were handling the right response. With the callbacks that integer request/response code is no longer necessary or used.
private val launcher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()){ result ->
if (result.resultCode == Activity.RESULT_OK) {
// handle the response in result.data
}
}
then you use it as others have indicated
val signInIntent = googleSignInClient.signInIntent
launcher.launch(signInIntent)
There are also some examples of this on the answers here