Inherits from APObject : NSObject
Declared in APUser.h
APUser.m

Class Methods

authenticateUserWithFacebook:successHandler:

+ (void)authenticateUserWithFacebook:(NSString *)accessToken successHandler:(APSuccessBlock)successBlock

Declared In

APUser.h

authenticateUserWithFacebook:successHandler:failureHandler:

Method to authenticate a user with facebook.

+ (void)authenticateUserWithFacebook:(NSString *)accessToken successHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

accessToken

The access token retrieved after a succesful facebook login.

successBlock

Block invoked when authentication with facebook is successful.

failureBlock

Block invoked when authentication with facebook is unsuccessful.

Discussion

If successful the currentUser is set to the authenticated user.

Declared In

APUser.h

authenticateUserWithTwitter:oauthSecret:consumerKey:consumerSecret:successHandler:

+ (void)authenticateUserWithTwitter:(NSString *)oauthToken oauthSecret:(NSString *)oauthSecret consumerKey:(NSString *)consumerKey consumerSecret:(NSString *)consumerSecret successHandler:(APSuccessBlock)successBlock

Declared In

APUser.h

authenticateUserWithTwitter:oauthSecret:consumerKey:consumerSecret:successHandler:failureHandler:

Method to authenticate a user with Twitter.

+ (void)authenticateUserWithTwitter:(NSString *)oauthToken oauthSecret:(NSString *)oauthSecret consumerKey:(NSString *)consumerKey consumerSecret:(NSString *)consumerSecret successHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

oauthToken

The oauth token retrieved after twitter login.

oauthSecret

The oauth secret.

consumerKey

The consumer key of the application created on twitter.

consumerSecret

The consumer secret of the application created on twitter.

successBlock

Block invoked when authentication with twitter is successful.

failureBlock

Block invoked when authentication with twitter is unsuccessful.

Discussion

If successful the currentUser is set to the authenticated user.

Declared In

APUser.h

authenticateUserWithTwitter:oauthSecret:successHandler:

+ (void)authenticateUserWithTwitter:(NSString *)oauthToken oauthSecret:(NSString *)oauthSecret successHandler:(APSuccessBlock)successBlock

Declared In

APUser.h

authenticateUserWithTwitter:oauthSecret:successHandler:failureHandler:

Method to authenticate a user with Twitter.

+ (void)authenticateUserWithTwitter:(NSString *)oauthToken oauthSecret:(NSString *)oauthSecret successHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

oauthToken

The oauth token retrieved after twitter login.

oauthSecret

The oauth secret.

successBlock

Block invoked when login with twitter is successful.

failureBlock

Block invoked when login with twitter is unsuccessful.

Discussion

If successful the currentUser is set to the authenticated user.

Declared In

APUser.h

authenticateUserWithUserName:password:successHandler:

authenticateUserWithUserName:password:successHandler:failureHandler

+ (void)authenticateUserWithUserName:(NSString *)userName password:(NSString *)password successHandler:(APSuccessBlock)successBlock

Declared In

APUser.h

authenticateUserWithUserName:password:successHandler:failureHandler:

Method to authenticate a user

+ (void)authenticateUserWithUserName:(NSString *)userName password:(NSString *)password successHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

userName

The username of the user to authenticate.

password

The password of the user to authenticate.

successBlock

Block invoked when authentication is successful.

failureBlock

Block invoked when authentication is unsuccessful.

Discussion

If successful the currentUser is set to the authenticated user.

Declared In

APUser.h

createUserWithDetails:successHandler:

+ (void)createUserWithDetails:(APUserDetails *)userDetails successHandler:(APUserSuccessBlock)successBlock

Declared In

APUser.h

createUserWithDetails:successHandler:failuderHandler:

Method to create a new user

+ (void)createUserWithDetails:(APUserDetails *)userDetails successHandler:(APUserSuccessBlock)successBlock failuderHandler:(APFailureBlock)failureBlock

Parameters

userDetails

The details of the new user.

successBlock

Block invoked when the create request is successful.

failureBlock

Block invoked when the create request is unsuccessful.

Discussion

If successful the an object of APUser is returned in the successBlock.

Note: This method does not set the current user as the new user.

Declared In

APUser.h

currentUser

Returns the current authenticated user.

+ (APUser *)currentUser

Return Value

APUser or nil

Declared In

APUser.h

setCurrentUser:

Helper method to set the current user.

+ (void)setCurrentUser:(APUser *)user

Parameters

user

The new current user

Declared In

APUser.h