ConnectedDevicesAccountManager Class
- java.
lang. Object - NativeBase
- com.
microsoft. connecteddevices. ConnectedDevicesAccountManager
- com.
public class ConnectedDevicesAccountManager
Provides a single entrypoint for all account-related features in the SDK.
Method Summary
Modifier and Type | Method and Description |
---|---|
Event<Connected |
accessTokenInvalidated()
This event is fired when a token consumer reports a token error. The token request subscriber needs to either refresh their token cache or request a new user login to fix their account setup. |
Event<Connected |
accessTokenRequested()
This event is fired when there is a need to request a token. This event should be subscribed and ready to respond before any request is sent out. |
Async |
addAccountAsync(@NonNull final ConnectedDevicesAccount account)
Add an account to account manager, callback will be invoked when it completes. The callback result indicates if Account Addition is successful or not. AddAccountAsync can trigger #accessTokenRequested to fire, thus App needs to make sure its token library is ready to repond to the token request before Calling into AddAccountAsync. If not, callback will be invoked with ConnectedDevicesAccountAddedStatus |
List<Connected |
getAccounts()
Return all ConnectedDevicesAccount which are currently tracked by this manager. |
Async |
removeAccountAsync(@NonNull final ConnectedDevicesAccount account)
Removes an ConnectedDevicesAccount from ConnectedDevicesAccountManager, callback will be invoked when it completes. |
Method Details
accessTokenInvalidated
public Event
This event is fired when a token consumer reports a token error. The token request subscriber needs to either refresh their token cache or request a new user login to fix their account setup.
Returns:
accessTokenRequested
public Event
This event is fired when there is a need to request a token. This event should be subscribed and ready to respond before any request is sent out.
Returns:
addAccountAsync
public AsyncOperation
Add an account to account manager, callback will be invoked when it completes. The callback result indicates if Account Addition is successful or not. AddAccountAsync can trigger #accessTokenRequested to fire, thus App needs to make sure its token library is ready to repond to the token request before Calling into AddAccountAsync. If not, callback will be invoked with ConnectedDevicesAccountAddedStatus
Parameters:
Returns:
getAccounts
public List
Return all ConnectedDevicesAccount which are currently tracked by this manager.
Returns:
removeAccountAsync
public AsyncOperation
Removes an ConnectedDevicesAccount from ConnectedDevicesAccountManager, callback will be invoked when it completes.
Parameters:
Returns: