ConnectedDevicesAccountManager 類別
- java.
lang. Object - NativeBase
- com.
microsoft. connecteddevices. ConnectedDevicesAccountManager
- com.
public class ConnectedDevicesAccountManager
提供 SDK 中所有帳戶相關功能的單一進入點。
方法摘要
修飾詞與類型 | 方法與描述 |
---|---|
Event<Connected |
accessTokenInvalidated()
當令牌取用者報告權杖錯誤時,就會引發此事件。 權杖要求訂閱者必須重新整理其權杖快取,或要求新的使用者登入來修正其帳戶設定。 |
Event<Connected |
accessTokenRequested()
當需要要求權杖時,就會引發此事件。 此事件應該已訂閱並準備好在傳送任何要求之前進行回應。 |
Async |
addAccountAsync(@NonNull final ConnectedDevicesAccount account)
將帳戶新增至帳戶管理員,會在完成時叫用回呼。 回呼結果會指出帳戶新增是否成功。 AddAccountAsync 可以觸發來引發 #accessTokenRequested ,因此應用程式必須確定其權杖程式庫已準備好在呼叫 AddAccountAsync 之前回應權杖要求。 如果沒有,則會使用 來叫用回呼 ConnectedDevicesAccountAddedStatus |
List<Connected |
getAccounts()
傳回此管理員目前追蹤的所有 ConnectedDevicesAccount 專案。 |
Async |
removeAccountAsync(@NonNull final ConnectedDevicesAccount account)
ConnectedDevicesAccountConnectedDevicesAccountManager 從 移除 ,會在完成時叫用回呼。 |
方法詳細資料
accessTokenInvalidated
public Event
當令牌取用者報告權杖錯誤時,就會引發此事件。 權杖要求訂閱者必須重新整理其權杖快取,或要求新的使用者登入來修正其帳戶設定。
Returns:
accessTokenRequested
public Event
當需要要求權杖時,就會引發此事件。 此事件應該已訂閱並準備好在傳送任何要求之前進行回應。
Returns:
addAccountAsync
public AsyncOperation
將帳戶新增至帳戶管理員,會在完成時叫用回呼。 回呼結果會指出帳戶新增是否成功。 AddAccountAsync 可以觸發來引發 #accessTokenRequested ,因此應用程式必須確定其權杖程式庫已準備好在呼叫 AddAccountAsync 之前回應權杖要求。 如果沒有,則會使用 來叫用回呼 ConnectedDevicesAccountAddedStatus
Parameters:
Returns:
getAccounts
public List
傳回此管理員目前追蹤的所有 ConnectedDevicesAccount 專案。
Returns:
removeAccountAsync
public AsyncOperation
ConnectedDevicesAccountConnectedDevicesAccountManager 從 移除 ,會在完成時叫用回呼。
Parameters:
Returns: