Stay organized with collections
Save and categorize content based on your preferences.
PrepareGetCredentialResponse
class PrepareGetCredentialResponse
A response object that prefetches user app credentials and provides metadata about them. It can then be used to issue the full credential retrieval flow via the CredentialManager.getCredential(Context, PendingGetCredentialHandle, CancellationSignal,
method to perform the remaining flows such as consent collection and credential selection, to officially retrieve a credential.
Summary
Nested classes |
|
A handle that represents a pending get-credential operation.
|
Public methods |
PrepareGetCredentialResponse.PendingGetCredentialHandle |
Returns a handle that represents this pending get-credential operation.
|
Boolean |
Returns true if the user has any candidate authentication actions (locked credential supplier), and false otherwise.
|
Boolean |
Returns true if the user has any candidate credentials for the given credentialType , and false otherwise.
|
Boolean |
Returns true if the user has any candidate remote credential results, and false otherwise.
|
Public methods
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# PrepareGetCredentialResponse\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPrepareGetCredentialResponse\n============================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/credentials/PrepareGetCredentialResponse \"View this page in Java\") \n\n```\nclass PrepareGetCredentialResponse\n```\n\n|---|-------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.credentials.PrepareGetCredentialResponse](#) |\n\nA response object that prefetches user app credentials and provides metadata about them. It can then be used to issue the full credential retrieval flow via the [CredentialManager.getCredential(Context, PendingGetCredentialHandle, CancellationSignal,](/reference/kotlin/android/credentials/CredentialManager#getCredential(android.content.Context,%20android.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle,%20android.os.CancellationSignal,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)) method to perform the remaining flows such as consent collection and credential selection, to officially retrieve a credential.\n\nSummary\n-------\n\n| Nested classes ||\n|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [PendingGetCredentialHandle](/reference/kotlin/android/credentials/PrepareGetCredentialResponse.PendingGetCredentialHandle) A handle that represents a pending get-credential operation. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [PrepareGetCredentialResponse.PendingGetCredentialHandle](/reference/kotlin/android/credentials/PrepareGetCredentialResponse.PendingGetCredentialHandle) | [getPendingGetCredentialHandle](#getPendingGetCredentialHandle())`()` Returns a handle that represents this pending get-credential operation. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [hasAuthenticationResults](#hasAuthenticationResults())`()` Returns true if the user has any candidate authentication actions (locked credential supplier), and false otherwise. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [hasCredentialResults](#hasCredentialResults(kotlin.String))`(`credentialType:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Returns true if the user has any candidate credentials for the given `credentialType`, and false otherwise. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [hasRemoteResults](#hasRemoteResults())`()` Returns true if the user has any candidate remote credential results, and false otherwise. |\n\nPublic methods\n--------------\n\n### getPendingGetCredentialHandle\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getPendingGetCredentialHandle(): PrepareGetCredentialResponse.PendingGetCredentialHandle\n```\n\nReturns a handle that represents this pending get-credential operation. Pass this handle to [CredentialManager.getCredential(Context, PendingGetCredentialHandle,](/reference/kotlin/android/credentials/CredentialManager#getCredential(android.content.Context,%20android.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle,%20android.os.CancellationSignal,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)) to perform the remaining flows to officially retrieve a credential.\n\n| Return ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------|\n| [PrepareGetCredentialResponse.PendingGetCredentialHandle](/reference/kotlin/android/credentials/PrepareGetCredentialResponse.PendingGetCredentialHandle) | This value cannot be `null`. |\n\n### hasAuthenticationResults\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun hasAuthenticationResults(): Boolean\n```\n\nReturns true if the user has any candidate authentication actions (locked credential supplier), and false otherwise. \nRequires [android.Manifest.permission#CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS](../Manifest.permission.html#CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS:kotlin.String) \n\n### hasCredentialResults\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun hasCredentialResults(credentialType: String): Boolean\n```\n\nReturns true if the user has any candidate credentials for the given `credentialType`, and false otherwise. \nRequires [android.Manifest.permission#CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS](../Manifest.permission.html#CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS:kotlin.String)\n\n| Parameters ||\n|------------------|----------------------------------------------------------------------------------------------------------------|\n| `credentialType` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |\n\n### hasRemoteResults\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun hasRemoteResults(): Boolean\n```\n\nReturns true if the user has any candidate remote credential results, and false otherwise. \nRequires [android.Manifest.permission#CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS](../Manifest.permission.html#CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS:kotlin.String)"]]