共用方式為


ConnectedDevicesAccountManager 類別

  • java.lang.Object
    • NativeBase
      • com.microsoft.connecteddevices.ConnectedDevicesAccountManager

public class ConnectedDevicesAccountManager

提供 SDK 中所有帳戶相關功能的單一進入點。

方法摘要

修飾詞與類型 方法與描述
Event<ConnectedDevicesAccountManager, ConnectedDevicesAccessTokenInvalidatedEventArgs> accessTokenInvalidated()

當令牌取用者報告權杖錯誤時,就會引發此事件。 權杖要求訂閱者必須重新整理其權杖快取,或要求新的使用者登入來修正其帳戶設定。

Event<ConnectedDevicesAccountManager, ConnectedDevicesAccessTokenRequestedEventArgs> accessTokenRequested()

當需要要求權杖時,就會引發此事件。 此事件應該已訂閱並準備好在傳送任何要求之前進行回應。

AsyncOperation<ConnectedDevicesAddAccountResult> addAccountAsync(@NonNull final ConnectedDevicesAccount account)

將帳戶新增至帳戶管理員,會在完成時叫用回呼。 回呼結果會指出帳戶新增是否成功。 AddAccountAsync 可以觸發來引發 #accessTokenRequested ,因此應用程式必須確定其權杖程式庫已準備好在呼叫 AddAccountAsync 之前回應權杖要求。 如果沒有,則會使用 來叫用回呼 ConnectedDevicesAccountAddedStatus

List<ConnectedDevicesAccount> getAccounts()

傳回此管理員目前追蹤的所有 ConnectedDevicesAccount 專案。

AsyncOperation<ConnectedDevicesRemoveAccountResult> removeAccountAsync(@NonNull final ConnectedDevicesAccount account)

ConnectedDevicesAccountConnectedDevicesAccountManager 從 移除 ,會在完成時叫用回呼。

方法詳細資料

accessTokenInvalidated

public Event accessTokenInvalidated()

當令牌取用者報告權杖錯誤時,就會引發此事件。 權杖要求訂閱者必須重新整理其權杖快取,或要求新的使用者登入來修正其帳戶設定。

Returns:

事件訂用帳戶

accessTokenRequested

public Event accessTokenRequested()

當需要要求權杖時,就會引發此事件。 此事件應該已訂閱並準備好在傳送任何要求之前進行回應。

Returns:

事件訂用帳戶

addAccountAsync

public AsyncOperation addAccountAsync(@NonNull final ConnectedDevicesAccount account)

將帳戶新增至帳戶管理員,會在完成時叫用回呼。 回呼結果會指出帳戶新增是否成功。 AddAccountAsync 可以觸發來引發 #accessTokenRequested ,因此應用程式必須確定其權杖程式庫已準備好在呼叫 AddAccountAsync 之前回應權杖要求。 如果沒有,則會使用 來叫用回呼 ConnectedDevicesAccountAddedStatus

Parameters:

account - 要 ConnectedDevicesAccount 新增至平臺的 。

Returns:

新增帳戶作業的結果

getAccounts

public List getAccounts()

傳回此管理員目前追蹤的所有 ConnectedDevicesAccount 專案。

Returns:

removeAccountAsync

public AsyncOperation removeAccountAsync(@NonNull final ConnectedDevicesAccount account)

ConnectedDevicesAccountConnectedDevicesAccountManager 從 移除 ,會在完成時叫用回呼。

Parameters:

account - 要移除的 ConnectedDevicesAccount

Returns:

移除帳戶作業的結果

適用於