Inherits from ENAPI
Declared in EvernoteUserStore.h
EvernoteUserStore.m

Overview

Asynchronous functions for all the user store api’s.

This class is a wrapper over all the User store api’s that provides asynchronism and abstraction.

Some utility functions for the Evernote UserStore, which makes it easier to use Business API’s.

Tasks

Creating a NoteStore

UserStore methods

Extras Methods

Class Methods

userStore

Get an instance, using the shared EvernoteSession.

+ (instancetype)userStore

Discussion

Get an instance, using the shared EvernoteSession.

Declared In

EvernoteUserStore.h

Instance Methods

authenticateToBusinessWithSuccess:failure:

This is used to take an existing authentication token that grants access to an individual user account (returned from ‘authenticate’, ‘authenticateLongSession’ or an OAuth authorization) and obtain an additional authentication token that may be used to access business notebooks if the user is a member of an Evernote Business account.

- (void)authenticateToBusinessWithSuccess:(void ( ^ ) ( EDAMAuthenticationResult *authenticationResult ))success failure:(void ( ^ ) ( NSError *error ))failure

Parameters

success

Success completion block.

failure

Failure completion block.

Discussion

This is used to take an existing authentication token that grants access to an individual user account (returned from ‘authenticate’, ‘authenticateLongSession’ or an OAuth authorization) and obtain an additional authentication token that may be used to access business notebooks if the user is a member of an Evernote Business account.

The resulting authentication token may be used to make NoteStore API calls against the business using the NoteStore URL returned in the result.

Declared In

EvernoteUserStore.h

checkVersionWithClientName:edamVersionMajor:edamVersionMinor:success:failure:

This should be the first call made by a client to the EDAM service. It tells the service what protocol version is used by the client.

- (void)checkVersionWithClientName:(NSString *)clientName edamVersionMajor:(int16_t)edamVersionMajor edamVersionMinor:(int16_t)edamVersionMinor success:(void ( ^ ) ( BOOL versionOK ))success failure:(void ( ^ ) ( NSError *error ))failure

Parameters

clientName

This string provides some information about the client for tracking/logging on the service. It should provide information about the client’s software and platform. The structure should be: application/version; platform/version; [ device/version ] E.g. “Evernote Windows/3.0.1; Windows/XP SP3” or “Evernote Clipper/1.0.1; JME/2.0; Motorola RAZR/2.0;

edamVersionMajor

This should be the major protocol version that was compiled by the client. This should be the current value of the EDAM_VERSION_MAJOR constant for the client.

edamVersionMinor

This should be the major protocol version that was compiled by the client. This should be the current value of the EDAM_VERSION_MINOR constant for the client.

success

Success completion block.

failure

Failure completion block.

Discussion

This should be the first call made by a client to the EDAM service. It tells the service what protocol version is used by the client.

The service will then return true if the client is capable of talking to the service, and false if the client’s protocol version is incompatible with the service, so the client must upgrade. If a client receives a false value, it should report the incompatibility to the user and not continue with any more EDAM requests (UserStore or NoteStore).

Declared In

EvernoteUserStore.h

getBootstrapInfoWithLocale:success:failure:

This provides bootstrap information to the client.

- (void)getBootstrapInfoWithLocale:(NSString *)locale success:(void ( ^ ) ( EDAMBootstrapInfo *info ))success failure:(void ( ^ ) ( NSError *error ))failure

Parameters

locale

The client’s current locale, expressed in language[_country] format. E.g., “en_US”. See ISO-639 and ISO-3166 for valid language and country codes.

success

Success completion block.

failure

Failure completion block.

Discussion

This provides bootstrap information to the client.

Various bootstrap profiles and settings may be used by the client to configure itself.

Declared In

EvernoteUserStore.h

getNoteStoreUrlWithSuccess:failure:

Returns the URL that should be used to talk to the NoteStore for the account represented by the provided authenticationToken.

- (void)getNoteStoreUrlWithSuccess:(void ( ^ ) ( NSString *noteStoreUrl ))success failure:(void ( ^ ) ( NSError *error ))failure

Parameters

success

Success completion block.

failure

Failure completion block.

Discussion

Returns the URL that should be used to talk to the NoteStore for the account represented by the provided authenticationToken.

This method isn’t needed by most clients, who can retrieve the correct NoteStore URL from the AuthenticationResult returned from the authenticate or refreshAuthentication calls. This method is typically only needed to look up the correct URL for a long-lived session token (e.g. for an OAuth web service).

Declared In

EvernoteUserStore.h

getPremiumInfoWithSuccess:failure:

Returns information regarding a user’s Premium account corresponding to the provided authentication token, or throws an exception if this token is not valid.

- (void)getPremiumInfoWithSuccess:(void ( ^ ) ( EDAMPremiumInfo *info ))success failure:(void ( ^ ) ( NSError *error ))failure

Parameters

success

Success completion block.

failure

Failure completion block.

Discussion

Returns information regarding a user’s Premium account corresponding to the provided authentication token, or throws an exception if this token is not valid.

Declared In

EvernoteUserStore.h

getPublicUserInfoWithUsername:success:failure:

Asks the UserStore about the publicly available location information for a particular username.

- (void)getPublicUserInfoWithUsername:(NSString *)username success:(void ( ^ ) ( EDAMPublicUserInfo *info ))success failure:(void ( ^ ) ( NSError *error ))failure

Parameters

username

The username for the location information

success

Success completion block.

failure

Failure completion block.

Discussion

Asks the UserStore about the publicly available location information for a particular username.

Declared In

EvernoteUserStore.h

getUserWithSuccess:failure:

Returns the User corresponding to the provided authentication token, or throws an exception if this token is not valid.

- (void)getUserWithSuccess:(void ( ^ ) ( EDAMUser *user ))success failure:(void ( ^ ) ( NSError *error ))failure

Parameters

success

Success completion block.

failure

Failure completion block.

Discussion

Returns the User corresponding to the provided authentication token, or throws an exception if this token is not valid.

The level of detail provided in the returned User structure depends on the access level granted by the token, so a web service client may receive fewer fields than an integrated desktop client.

Declared In

EvernoteUserStore.h

initWithSession:

Construct an instance with the given session.

- (id)initWithSession:(EvernoteSession *)session

Parameters

session

The Evernote session object

Discussion

Construct an instance with the given session.

Declared In

EvernoteUserStore.h

isUserMemberOfBusinessWithSuccess:failure:

Check if the user is a member of a business premium account.

- (void)isUserMemberOfBusinessWithSuccess:(void ( ^ ) ( BOOL isMemberOfBusiness ))success failure:(void ( ^ ) ( NSError *error ))failure

Parameters

success

Success completion block.

failure

Failure completion block.

Discussion

Check if the user is a member of a business premium account.

Declared In

EvernoteUserStore+Extras.h