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 所需的上下文;使用活動上下文確保使用者介面會在同一任務堆疊中啟動
- request
- GetCredentialRequest
指定使用者要取得的憑證類型請求
- cancellationSignal
- CancellationSignal
一個可選的訊號,允許取消此通話
- executor
- IExecutor
回試將在此進行 Executor
- callback
- IOutcomeReceiver
當請求成功或失敗時所呼叫的回調
- 屬性
備註
啟動必要的流程,從使用者那裡取得應用程式憑證。
執行過程中可能啟動 UI 流程,收集使用者對使用憑證的同意,當存在多個憑證時顯示選擇器等。呼叫者(例如瀏覽器)可選擇為與自己不同的應用程式設定來源 GetCredentialRequest ,以代表該應用程式取得憑證。 他們需要額外權限 CREDENTIAL_MANAGER_SET_ORIGIN 才能使用此功能
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
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
- 屬性