-
Notifications
You must be signed in to change notification settings - Fork 17
Account
As mentioned previously on the Authentication page, the Account class contains methods and properties specific to the current logged in user.
public OAuthTokens AccountTokens { get; set; }Instance of the OAuthTokens class that contains the Authorization and Refresh tokens for the current account.
public Profile Profile { get; protected set; }Instance of the Profile class that contains details for the logged in account such as onlineId, trophy levels, avatar, etc.
public Account(OAuthTokens tokens)Accepts an OAuthTokens object with the account's tokens. This gets stored in AccountTokens.
public async Task<bool> AddFriend(string psn, string requestMessage = "")Adds the psn passed to the method, with an optional message to be sent with the request. This is an alernative to User.AddFriend.
public async Task<bool> RemoveFriend(string psn) Removes the psn passed to the method from the currently logged in user's account. The user must be added already, otherwise the method will throw an exception.
public async Task<List<User>> GetFriends(string filter = "online", int limit = 36)Grabs all the friends added to the currently logged in user's account and returns a List of User objects. Accepts an optional filter parameter to sort which friends to grab and a limit parameter to limit how many friends get returned.