Reputation: 1245
i am doing a reder application which can sync note to evernote,i found the API and sample code i integrate it my application and cotomize it according to out needs.and i create a sandbox useraccount for checking app before production service.in the evernoteclass.m we need to give the username and password by static there is a code like this
#import "Evernote.h"
NSString * const username = @"usernme";
NSString * const password = @"pswrd123";
NSString * const userStoreUri = @"https://sandbox.evernote.com/edam/user";
NSString * const noteStoreUriBase = @"https://sandbox.evernote.com/edam/note/";
@implementation Evernote
but i need to implement this by using username and password textfield like our login page. by add ing this value staticly i am able to send note to evernote how to give the username dynamically using textfileds. thanks in advance.
Upvotes: 1
Views: 513
Reputation: 1083
With the latest evernote ios sdk, you can get authentication by oauth.
// set up Evernote session singleton
[EvernoteSession setSharedSessionHost:EVERNOTE_HOST
consumerKey:EVERNOTE_CONSUMER_KEY
consumerSecret:EVERNOTE_CONSUMER_SECRET];
EvernoteSession *session = [EvernoteSession sharedSession];
[session authenticateWithCompletionHandler:^(NSError *error) {
if (error || !session.isAuthenticated) {
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Error"
message:@"Could not authenticate"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil] autorelease];
[alert show];
} else {
DLog(@"Evernote auth ready");
[self _authDidCompleted];
}
}];
Upvotes: 1
Reputation: 2912
Create two Textfields, One for Username and the other for password. Create IBOutlets as well. Then you can write the following code
NSString * const username = textField1.text;
NSString * const password = textField2.text;
I dont really know if u got your question correctly. But, hope this helps.....
Upvotes: 0