Show / Hide Table of Contents

Interface IUserManager

The interface for the User Manager.

Namespace: Phoenix.Users
Assembly: Phoenix.Abstractions.Users.dll
Syntax
public interface IUserManager

Methods

View Source

AddUserAsync(String, IDevice)

Adds a user to a device.

Declaration
Task<PhoenixUser> AddUserAsync(string email, IDevice device)
Parameters
Type Name Description
System.String email

The email associated with a user.

IDevice device

The device to add a user to.

Returns
Type Description
System.Threading.Tasks.Task<PhoenixUser>

A System.Threading.Tasks.Task that returns the new PhoenixUser.

View Source

AddUserAsync(String, String, IDevice)

Adds a user to a device and signs user in with provided password.

Declaration
Task<PhoenixUser> AddUserAsync(string email, string password, IDevice device)
Parameters
Type Name Description
System.String email

The email associated with a user.

System.String password

The password to sign in the user.

IDevice device

The device to add a user to.

Returns
Type Description
System.Threading.Tasks.Task<PhoenixUser>

A System.Threading.Tasks.Task that returns the new PhoenixUser.

View Source

ClearDefaultSignedInUserAsync(IDevice)

Clears the default signed in user on specified device.

Declaration
Task ClearDefaultSignedInUserAsync(IDevice device)
Parameters
Type Name Description
IDevice device

The device to clear the default signed in user.

Returns
Type Description
System.Threading.Tasks.Task

The task performing the request.

View Source

GetDefaultSignedInUserEmailAsync(IDevice)

Gets the default signed in user on specified device.

Declaration
Task<string> GetDefaultSignedInUserEmailAsync(IDevice device)
Parameters
Type Name Description
IDevice device

The device to get the default signed in user from.

Returns
Type Description
System.Threading.Tasks.Task<System.String>

The default user email.

View Source

GetUserOfEmail(String, IDevice)

Gets a cached user based on email.

Declaration
PhoenixUser GetUserOfEmail(string email, IDevice device)
Parameters
Type Name Description
System.String email

The email associated with the user.

IDevice device

The device to look for the user in.

Returns
Type Description
PhoenixUser

The user.

View Source

GetUsersAsync(IDevice)

Asynchronously gets a list of users from a device.

Declaration
Task<IEnumerable<PhoenixUser>> GetUsersAsync(IDevice device)
Parameters
Type Name Description
IDevice device

The device to get users from.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<PhoenixUser>>

A list of devices.

Remarks

On first call users will be grabbed. Any further call will return the cached results. Call RefreshDevicesAsync() or RefreshDeviceAsync(IDevice) to regenerated the list.

View Source

GetUsersOfEmail(String)

Gets a list of a specific user across devices all cached devices.

Declaration
IEnumerable<PhoenixUser> GetUsersOfEmail(string email)
Parameters
Type Name Description
System.String email

The email associated with the user to search for.

Returns
Type Description
System.Collections.Generic.IEnumerable<PhoenixUser>

List of the specified user per device the user was found in.

Remarks

GetUsersAsync(IDevice), RefreshDevicesAsync(), or RefreshDeviceAsync(IDevice) must first be called, otherwise it will return null.

View Source

RefreshDeviceAsync(IDevice)

Asynchronously refreshes specified device.

Declaration
Task RefreshDeviceAsync(IDevice device)
Parameters
Type Name Description
IDevice device

The device.

Returns
Type Description
System.Threading.Tasks.Task

The task running.

View Source

RefreshDevicesAsync()

Asynchronously refreshes all current devices.

Declaration
Task RefreshDevicesAsync()
Returns
Type Description
System.Threading.Tasks.Task

The task running.

View Source

RemoveAllUsersAsync(IDevice)

Removes all users from a device.

Declaration
Task RemoveAllUsersAsync(IDevice device)
Parameters
Type Name Description
IDevice device

The device to remove all users from.

Returns
Type Description
System.Threading.Tasks.Task

The task performing the request.

View Source

RemoveUserAsync(PhoenixUser)

Removes a user from a device.

Declaration
Task<bool> RemoveUserAsync(PhoenixUser user)
Parameters
Type Name Description
PhoenixUser user

The user to remove.

Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

A task which will return true if the removal was successful, false otherwise.

View Source

SignInAsync(PhoenixUser)

Signs the user in. It is assumed the password is stored on the device. Calling this method will raise the UserSignedInEvent Even though this method is supposed to not store the user's password, currently this option is ignored by the platform and the password is stored either way.

Declaration
Task<bool> SignInAsync(PhoenixUser user)
Parameters
Type Name Description
PhoenixUser user

The user to sign in.

Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

A task which will return true if the sign in was successful, false otherwise.

View Source

SignOutAsync(PhoenixUser)

Signs the user out. Calling this method will raise the UserSignedOutEvent.

Declaration
Task<bool> SignOutAsync(PhoenixUser user)
Parameters
Type Name Description
PhoenixUser user

The user to sign out.

Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

True if sign out was successful, false otherwise.

  • View Source
In This Article
Back to top Generated by DocFX