EVUser Class Reference
Inherits from | EVObject : NSObject |
Conforms to | NSCoding |
Declared in | EVUser.h |
Overview
An Everlive user object that is the local representation of the user persisted to the Everlive cloud.
Tasks
-
+ allUsers:
Returns all users from everlive.
-
+ fetchUser:block:
Returns the specific user.
-
+ fetchUserWithEmail:block:
Returns the user for email.
-
+ fetchWithAccessToken:block:
Returns information about the currently logged in user
-
+ setNewPassword:withSecretQuestionId:andSecretAnswer:newPassword:block:
Sets a new password for the user with the specified username by using the secret question and secret answer
-
+ setNewPasswordWithResetCode:newPassword:block:
Sets a new password for the user with the specified reset code
-
+ resendVerificationEmailWithUserId:block:
Resends the verification email for the user with the specified ID
-
+ resendVerificationEmailWithUsername:block:
Resends the verification email for the user with the specified username
-
+ currentUser
Return the current logged in user from disk.
-
+ changePassword:oldPassword:newPassword:block:
Changes the password of the specified user.
-
+ loginInWithUsername:password:block:
Makes an asynchronous request to log in a user with specified credentials.
-
+ loginWithFacebook:block:
Makes an asynchronous request to log in a user with facebook access token.
-
+ loginWithLiveId:block:
Makes an asynchrounous request to log in a user with live id access token
-
+ loginWithGoogle:block:
Makes an asynchrounous request to log in a user with google access token
-
+ linkFacebookAccount:accessToken:block:
Links the everlive account with a Facebook account
-
+ linkLiveIdAccount:accessToken:block:
Links the everlive account with a LiveID account
-
+ linkGoogleAccount:accessToken:block:
Links the everlive account with a Google account
-
+ unlinkFacebookAccount:block:
Unlinks the everlive user account and the Facebook account
-
+ unlinkLiveIdAccount:block:
Unlinks the everlive user account and the LiveID account
-
+ unlinkGoogleAccount:block:
Unlinks the everlive user account and the Google account
-
+ logOut
Logs out the currenlty logged in user on disk.
-
– signUp:
Signs up the user. Make sure that username and password are set. This will also enforce that the username isn’t already taken.
-
– remove:
Removes the user from everlive. Must be authenticated to remove a user.
-
– isAuthenticated
Checks if the current user is logged in.
Class Methods
allUsers:
Returns all users from everlive.
+ (void)allUsers:(EVObjectFetchResultBlock)block
Parameters
- block
The block to execute. The block should have the following argument signature: (BOOL success, NSError *error)
Declared In
EVUser.h
changePassword:oldPassword:newPassword:block:
Changes the password of the specified user.
+ (void)changePassword:(NSString *)username oldPassword:(NSString *)oldPassword newPassword:(NSString *)newPassword block:(EVObjectResultBlock)block
Parameters
- username
The username of the user.
- oldPassword
The old password of the user.
- newPassword
The new password of the user.
- block
The block to execute. The block should have the following argument signature: (BOOL success, NSError *error)
Declared In
EVUser.h
currentUser
Return the current logged in user from disk.
+ (EVUser *)currentUser
Declared In
EVUser.h
fetchUser:block:
Returns the specific user.
+ (void)fetchUser:(id)userId block:(EVUserResultBlock)block
Parameters
- userId
The id against which the user will be retrieved.
- block
The block to execute. The block should have the following argument signature: (EVUser user, NSError error)
Declared In
EVUser.h
fetchUserWithEmail:block:
Returns the user for email.
+ (void)fetchUserWithEmail:(NSString *)email block:(EVUserResultBlock)block
Parameters
The email to get the user for.
- block
The block to execute. The block should have the following argument signature: (EVUser user, NSError error)
Declared In
EVUser.h
fetchWithAccessToken:block:
Returns information about the currently logged in user
+ (void)fetchWithAccessToken:(NSString *)accessToken block:(EVUserResultBlock)block
Parameters
- accessToken
The access token that should be passed for authentication of the request.
- block
The block to execute. The block should have the following argument signature: (EVUser user, NSError error)
Declared In
EVUser.h
linkFacebookAccount:accessToken:block:
Links the everlive account with a Facebook account
+ (void)linkFacebookAccount:(NSString *)userId accessToken:(NSString *)accessToken block:(EVObjectResultBlock)block
Parameters
- userId
The Id of the user
- accessToken
The access token from the external provider
- block
The block to execute
Declared In
EVUser.h
linkGoogleAccount:accessToken:block:
Links the everlive account with a Google account
+ (void)linkGoogleAccount:(NSString *)userId accessToken:(NSString *)accessToken block:(EVObjectResultBlock)block
Parameters
- userId
The Id of the user
- accessToken
The access token from the external provider
- block
The block to execute
Declared In
EVUser.h
linkLiveIdAccount:accessToken:block:
Links the everlive account with a LiveID account
+ (void)linkLiveIdAccount:(NSString *)userId accessToken:(NSString *)accessToken block:(EVObjectResultBlock)block
Parameters
- userId
The Id of the user
- accessToken
The access token from the external provider
- block
The block to execute
Declared In
EVUser.h
loginInWithUsername:password:block:
Makes an asynchronous request to log in a user with specified credentials.
+ (void)loginInWithUsername:(NSString *)username password:(NSString *)password block:(EVUserResultBlock)block
Parameters
- username
The username of the user.
- password
The password of the user.
- block
The block to execute. The block should have the following argument signature: (EVUser user, NSError error)
Declared In
EVUser.h
loginWithFacebook:block:
Makes an asynchronous request to log in a user with facebook access token.
+ (void)loginWithFacebook:(NSString *)accessToken block:(EVUserResultBlock)block
Parameters
- accessToken
The access token obtained from Facebook.
- block
The block to execute. The block should have the following argument signature: (EVUser user, NSError error)
Declared In
EVUser.h
loginWithGoogle:block:
Makes an asynchrounous request to log in a user with google access token
+ (void)loginWithGoogle:(NSString *)accessToken block:(EVUserResultBlock)block
Parameters
- accessToken
The access token obtained from LiveId
- block
The block to execute. The block should have the following argument signature: (EVUser user, NSError error)
Declared In
EVUser.h
loginWithLiveId:block:
Makes an asynchrounous request to log in a user with live id access token
+ (void)loginWithLiveId:(NSString *)accessToken block:(EVUserResultBlock)block
Parameters
- accessToken
The access token obtained from LiveId
- block
The block to execute. The block should have the following argument signature: (EVUser user, NSError error)
Declared In
EVUser.h
resendVerificationEmailWithUserId:block:
Resends the verification email for the user with the specified ID
+ (void)resendVerificationEmailWithUserId:(id)userId block:(EVObjectResultBlock)block
Parameters
- userId
The id of the user
- block
The block to execute. The block should have the following argument signature: (BOOL success, NSError *error)
Declared In
EVUser.h
resendVerificationEmailWithUsername:block:
Resends the verification email for the user with the specified username
+ (void)resendVerificationEmailWithUsername:(NSString *)username block:(EVObjectResultBlock)block
Parameters
- username
The username for which to send verification email
- block
The block to execute. The block should have the following argument signature: (BOOL success, NSError *error)
Declared In
EVUser.h
setNewPassword:withSecretQuestionId:andSecretAnswer:newPassword:block:
Sets a new password for the user with the specified username by using the secret question and secret answer
+ (void)setNewPassword:(NSString *)username withSecretQuestionId:(NSString *)secretQuestionId andSecretAnswer:(NSString *)secretAnswer newPassword:(NSString *)newPassword block:(EVObjectResultBlock)block
Parameters
- username
The username identifying the user
- secretQuestionId
The secret question ID of the user
- secretAnswer
The answer to the secret question
- newPassword
The new password to set
- block
The block to execute. The block should have the following argument signature: (BOOL success, NSError *error)
Declared In
EVUser.h
setNewPasswordWithResetCode:newPassword:block:
Sets a new password for the user with the specified reset code
+ (void)setNewPasswordWithResetCode:(NSString *)resetCode newPassword:(NSString *)newPassword block:(EVObjectResultBlock)block
Parameters
- resetCode
The reset code
- newPassword
The new password to set
- block
The block to execute. The block should have the following argument signature: (BOOL success, NSError *error)
Declared In
EVUser.h
unlinkFacebookAccount:block:
Unlinks the everlive user account and the Facebook account
+ (void)unlinkFacebookAccount:(NSString *)userId block:(EVObjectResultBlock)block
Parameters
- userId
The user id
- block
The block to execute
Declared In
EVUser.h
Instance Methods
isAuthenticated
Checks if the current user is logged in.
- (BOOL)isAuthenticated
Declared In
EVUser.h
remove:
Removes the user from everlive. Must be authenticated to remove a user.
- (void)remove:(EVObjectResultBlock)block
Parameters
- block
The block to execute. The block should have the following argument signature: (EVUser user, NSError error)
Declared In
EVUser.h
signUp:
Signs up the user. Make sure that username and password are set. This will also enforce that the username isn’t already taken.
- (void)signUp:(EVUserResultBlock)block
Parameters
- block
The block to execute. The block should have the following argument signature: (EVUser user, NSError error)
Declared In
EVUser.h