File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
auth/app/src/main/java/com/google/firebase/quickstart/auth Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -83,18 +83,19 @@ public void onStart() {
8383 }
8484 // [END on_start_check_user]
8585
86- // [START launch_credential_manager]
8786 private void launchCredentialManager () {
88- // Create the configuration for the Credential Manager request
87+ // [START create_credential_manager_request]
88+ // Instantiate a Google sign-in request
8989 GetGoogleIdOption googleIdOption = new GetGoogleIdOption .Builder ()
9090 .setFilterByAuthorizedAccounts (true )
9191 .setServerClientId (getBaseContext ().getString (R .string .default_web_client_id ))
9292 .build ();
9393
94- // Create the Credential Manager request using the configuration created above
94+ // Create the Credential Manager request
9595 GetCredentialRequest request = new GetCredentialRequest .Builder ()
9696 .addCredentialOption (googleIdOption )
9797 .build ();
98+ // [END create_credential_manager_request]
9899
99100 // Launch Credential Manager UI
100101 credentialManager .getCredentialAsync (
@@ -116,7 +117,6 @@ public void onError(GetCredentialException e) {
116117 }
117118 );
118119 }
119- // [END launch_credential_manager]
120120
121121 // [START create_google_id_token]
122122 private void createGoogleIdToken (Credential credential ) {
Original file line number Diff line number Diff line change @@ -60,18 +60,20 @@ class GoogleSignInActivity : AppCompatActivity() {
6060 }
6161 // [END on_start_check_user]
6262
63- // [START launch_credential_manager]
63+
6464 private fun launchCredentialManager () {
65- // Create the configuration for the Credential Manager request
65+ // [START create_credential_manager_request]
66+ // Instantiate a Google sign-in request
6667 val googleIdOption = GetGoogleIdOption .Builder ()
6768 .setFilterByAuthorizedAccounts(true )
6869 .setServerClientId(baseContext.getString(R .string.default_web_client_id))
6970 .build()
7071
71- // Create the Credential Manager request using the configuration created above
72+ // Create the Credential Manager request
7273 val request = GetCredentialRequest .Builder ()
7374 .addCredentialOption(googleIdOption)
7475 .build()
76+ // [END create_credential_manager_request]
7577
7678 lifecycleScope.launch {
7779 try {
@@ -88,7 +90,6 @@ class GoogleSignInActivity : AppCompatActivity() {
8890 }
8991 }
9092 }
91- // [END launch_credential_manager]
9293
9394 // [START create_google_id_token]
9495 private fun createGoogleIdToken (credential : Credential ) {
You can’t perform that action at this time.
0 commit comments