2. About Me
• 5 years Mac Device Driver/Application developer
• 10 years Enterprise grade software development
tools consultant
• Now -> iOS/Android app developer
5. EasyShare for Evernote
• Practice-1 : Development environment setup and
using Evernote OAuth API
• Practice-2 : List all of notebooks in your Evernote
account
• Practice-3 : List all of notes in a notebook
• Practice-4 : Render note content in UIWebView
• Practice-5 : Share your note to social network
6. Practice-1 SDK setup &
OAuth
• Xcode 5.x +
• cocoapods installation—> sudo gem install
cocoapods
• Create an iOS project named EasyShare by Xcode
7. Evernote SDK setup
• create a file named Podfile in your root of project
plateform :iOS , ‘7.0’
pod ‘Evernote-SDK-iOS’, ‘1.3.1’
• pod install
• Open EasyShare.xcworkspace in Xcode
9. Initialize SDK -1
#import "EvernoteSDK.h"!
!
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:
(NSDictionary *)launchOptions!
{!
// Initial development is done on the sandbox service!
// Change this to BootstrapServerBaseURLStringUS to use the production Evernote
service!
// Change this to BootstrapServerBaseURLStringCN to use the Yinxiang Biji production
service!
// Bootstrapping is supported by default with either BootstrapServerBaseURLStringUS or
BootstrapServerBaseURLStringCN!
// BootstrapServerBaseURLStringSandbox does not support the Yinxiang Biji service!
NSString *EVERNOTE_HOST = BootstrapServerBaseURLStringUS; //使⽤用Production Server!
!
// Fill in the consumer key and secret with the values that you received from Evernote!
// To get an API key, visit http://dev.evernote.com/documentation/cloud/!
NSString *CONSUMER_KEY = @"your key";!
NSString *CONSUMER_SECRET = @"your secret";!
!
// set up Evernote session singleton!
[EvernoteSession setSharedSessionHost:EVERNOTE_HOST!
consumerKey:CONSUMER_KEY !
consumerSecret:CONSUMER_SECRET];!
}
17. SingleTon & Class need to
know in this practice
!
• [EvernoteStore noteStore] -> For ever note
related operation
• EDAMNotebook -> Class of Notebook object
21. Classes need to know in this
practice
• EDAMNoteFilter -> setup filter condition for query
notes
• EDAMNotesMetadataResultSpec -> Setup which
note metadata fields would return from cloud
• EDAMNoteMetadata -> Class of note metadata!
• EDAMNotesMetadataList , Container for notes
object array
32. setup pod would use in this
practice
• pod ‘LINEActivity’, ‘~>0.2’
• pod update
33. Classes need to know in this
practice
• [EvernoteUserStore userStore], For fetching user
related information like shardid
• EDAMUser Class of user object
34. Sharing note URL
generated by Evernote
• http://www.evernote.com/shard/{shardid}/sh/
{noteguid}/{notekey}
35. How to get user’s shard id?
• [[EvernoteUserStore userStore]
getUserWithSuccess:^(EDAMUser *user){}
failure:^(NSError *error){ NSString *shardId =
user.shardId}];
36. Share note then get note’s
sharing key
• [[EvernoteNoteStore noteStore]
shareNoteWithGuid:note.guid success:^(NSString
*key){} failure:^(NSError *error){}]
40. To Sync or not to ?
• Evernote Sync API is another topic, Sync API like
Mail IMAP protocol which sync all of cloud changes
set to your App
• Do you need all of notebook/notes in your App?
41. Rate Limit
• Limit for API calling for each hours
• Implement Cache in your App for reducing Rate
Limit exception
• Detail-> http://dev.evernote.com/doc/articles/
rate_limits.php
42.
43. Note thumbnails
• Note include in Evernote iOS SDK, Need to use
HTTP request to fetch each note’s thumb image
• Please refer to http://dev.evernote.com/doc/articles/
thumbnails.php
44. Notebook
• User’s own Notebook->EDAMNotebook
• Notebook shared by friend ->EDAMLinkbook
• Business Notebook
• Take care about differences between each
notebook interface
45. Limitations for Writing to
Evernote
• Note content body need to be ENML format,
EDAMWriter class could help you
• EDAMLimits.h & EDAMLimits.m has a lot of Regular
express for checking your input data