CredentialManager.GetCredential 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
GetCredential(Context, GetCredentialRequest, CancellationSignal, IExecutor, IOutcomeReceiver)
启动必要的流以从用户检索应用凭据。
[Android.Runtime.Register("getCredential", "(Landroid/content/Context;Landroid/credentials/GetCredentialRequest;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)]
public void GetCredential(Android.Content.Context context, Android.Credentials.GetCredentialRequest request, Android.OS.CancellationSignal? cancellationSignal, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("getCredential", "(Landroid/content/Context;Landroid/credentials/GetCredentialRequest;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)>]
member this.GetCredential : Android.Content.Context * Android.Credentials.GetCredentialRequest * Android.OS.CancellationSignal * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
参数
- context
- Context
用于启动任何所需 UI 的上下文;使用活动上下文确保在同一任务堆栈中启动 UI
- request
- GetCredentialRequest
指定要从用户获取的凭据类型的请求
- cancellationSignal
- CancellationSignal
允许取消此调用的可选信号
- executor
- IExecutor
回调将对此进行 Executor
- callback
- IOutcomeReceiver
请求成功或失败时调用的回调
- 属性
注解
启动必要的流以从用户检索应用凭据。
执行可能会启动 UI 流,以收集用户同意使用凭据、在存在多个凭据时显示选取器等。调用方(例如浏览器)可以选择为与自己的应用不同的应用设置源 GetCredentialRequest
,以便能够代表该应用获取凭据。 他们需要其他权限 CREDENTIAL_MANAGER_SET_ORIGIN
才能使用此功能
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
GetCredential(Context, PrepareGetCredentialResponse+PendingGetCredentialHandle, CancellationSignal, IExecutor, IOutcomeReceiver)
[Android.Runtime.Register("getCredential", "(Landroid/content/Context;Landroid/credentials/PrepareGetCredentialResponse$PendingGetCredentialHandle;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)]
public void GetCredential(Android.Content.Context context, Android.Credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle pendingGetCredentialHandle, Android.OS.CancellationSignal? cancellationSignal, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("getCredential", "(Landroid/content/Context;Landroid/credentials/PrepareGetCredentialResponse$PendingGetCredentialHandle;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)>]
member this.GetCredential : Android.Content.Context * Android.Credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle * Android.OS.CancellationSignal * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
参数
- context
- Context
- pendingGetCredentialHandle
- PrepareGetCredentialResponse.PendingGetCredentialHandle
- cancellationSignal
- CancellationSignal
- executor
- IExecutor
- callback
- IOutcomeReceiver
- 属性