SaveAccountLinkingTokenRequest.Builder

public static final class SaveAccountLinkingTokenRequest.Builder extends Object

Public Constructor Summary

Public Method Summary

SaveAccountLinkingTokenRequest
build()
Builds an immutable instance of the SaveAccountLinkingTokenRequest.
SaveAccountLinkingTokenRequest.Builder
setConsentPendingIntent(PendingIntent consentPendingIntent)
Sets the (mandatory) PendingIntent that can be launched by Google Play services to show the consent page during the flow.
SaveAccountLinkingTokenRequest.Builder
setScopes(List<String> scopes)
Sets the list of scopes that are associated with the token that will be saved to Google.
SaveAccountLinkingTokenRequest.Builder
setServiceId(String serviceId)
Sets the service-id that can be obtained from your Google Cloud project.
SaveAccountLinkingTokenRequest.Builder
setTokenType(String tokenType)
Sets the type of token that will be saved to Google.

Inherited Method Summary

Public Constructors

public Builder ()

Public Methods

public SaveAccountLinkingTokenRequest build ()

Builds an immutable instance of the SaveAccountLinkingTokenRequest.

public SaveAccountLinkingTokenRequest.Builder setConsentPendingIntent (PendingIntent consentPendingIntent)

Sets the (mandatory) PendingIntent that can be launched by Google Play services to show the consent page during the flow. When the launched Activity is finished, it has to provide the appropriate data in the result that it returns to the caller, based on the following contract:

  • If the user has accepted the consent, the launched Activity must call setResult with RESULT_OK, along with a token as a (string) intent extra in the result, with the key SaveAccountLinkingTokenRequest.EXTRA_TOKEN, similar to the following snippet:
    Intent intent = new Intent();
     intent.putExtra(SaveAccountLinkingTokenRequest.EXTRA_TOKEN, token);
     setResult(Activity.RESULT_OK, intent);
     finish();
    
     
  • If, however, the user has rejected the consent, the Activity has to call setResult with RESULT_CANCELED.

public SaveAccountLinkingTokenRequest.Builder setScopes (List<String> scopes)

Sets the list of scopes that are associated with the token that will be saved to Google. Calling this method with the correct scope(s) is required.

public SaveAccountLinkingTokenRequest.Builder setServiceId (String serviceId)

Sets the service-id that can be obtained from your Google Cloud project. Calling this method to set serviceId is required.

public SaveAccountLinkingTokenRequest.Builder setTokenType (String tokenType)

Sets the type of token that will be saved to Google. Valid options are:

Calling this method with a valid token type is required.