ConnectedDevicesAccountManager Class

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

public class ConnectedDevicesAccountManager

Provides a single entrypoint for all account-related features in the SDK.

Method Summary

Modifier and Type Method and Description
Event<ConnectedDevicesAccountManager, ConnectedDevicesAccessTokenInvalidatedEventArgs> 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<ConnectedDevicesAccountManager, ConnectedDevicesAccessTokenRequestedEventArgs> 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.

AsyncOperation<ConnectedDevicesAddAccountResult> 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<ConnectedDevicesAccount> getAccounts()

Return all ConnectedDevicesAccount which are currently tracked by this manager.

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

Removes an ConnectedDevicesAccount from ConnectedDevicesAccountManager, callback will be invoked when it completes.

Method Details

accessTokenInvalidated

public Event 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.

Returns:

The event subscription

accessTokenRequested

public Event 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.

Returns:

The event subscription

addAccountAsync

public AsyncOperation 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

Parameters:

account - A ConnectedDevicesAccount to add to the platform.

Returns:

Result of add account operation

getAccounts

public List getAccounts()

Return all ConnectedDevicesAccount which are currently tracked by this manager.

Returns:

removeAccountAsync

public AsyncOperation removeAccountAsync(@NonNull final ConnectedDevicesAccount account)

Removes an ConnectedDevicesAccount from ConnectedDevicesAccountManager, callback will be invoked when it completes.

Parameters:

account - The ConnectedDevicesAccount to remove.

Returns:

Result of remove account operation

Applies to