ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Mustafa Furniturewala
Evernote
Mobile SDKs: Getting Started
with the Evernote API
Monday, September 30, 13
#EC2013
Evernote API
? Access to a user¡¯s Evernote account/business
? Read/Create/Find notes
? FindRelated/Reminders
Monday, September 30, 13
#EC2013
Mobile SDK¡¯s
Monday, September 30, 13
#EC2013
Mobile SDK¡¯s
? Easy to use - hide complexities
Monday, September 30, 13
#EC2013
Mobile SDK¡¯s
? Easy to use - hide complexities
? Local API¡¯s
Monday, September 30, 13
#EC2013
Mobile SDK¡¯s
? Easy to use - hide complexities
? Local API¡¯s
? Support popular environments (cocoapods/
maven)
Monday, September 30, 13
#EC2013
Mobile SDK¡¯s
? Easy to use - hide complexities
? Local API¡¯s
? Support popular environments (cocoapods/
maven)
? Wrappers
Monday, September 30, 13
#EC2013
Getting started
Monday, September 30, 13
#EC2013
Getting started
Monday, September 30, 13
#EC2013
Getting started
1. Create an account on sandbox.evernote.com
Monday, September 30, 13
#EC2013
Getting started
1. Create an account on sandbox.evernote.com
2. Get your consumer key
Monday, September 30, 13
#EC2013
Getting started
1. Create an account on sandbox.evernote.com
2. Get your consumer key
3. Download the SDK
Monday, September 30, 13
#EC2013
Getting started
1. Create an account on sandbox.evernote.com
2. Get your consumer key
3. Download the SDK
4. Start using the API¡¯s
Monday, September 30, 13
#EC2013
Authentication
Monday, September 30, 13
#EC2013
Authentication
1. OAuth 1.0a
Monday, September 30, 13
#EC2013
Authentication
1. OAuth 1.0a
2. Mobile SDK¡¯s handle everything for you
Monday, September 30, 13
#EC2013
Authentication
1. OAuth 1.0a
2. Mobile SDK¡¯s handle everything for you
3. Github
Monday, September 30, 13
#EC2013
Yinxiang Biji
Monday, September 30, 13
#EC2013
Yinxiang Biji
1. Evernote¡¯s China service
Monday, September 30, 13
#EC2013
Yinxiang Biji
1. Evernote¡¯s China service
2. Bootstrapping
Monday, September 30, 13
#EC2013
Yinxiang Biji
1. Evernote¡¯s China service
2. Bootstrapping
3. Mobile SDK¡¯s handle
everything for you
Monday, September 30, 13
#EC2013
Yinxiang Biji
1. Evernote¡¯s China service
2. Bootstrapping
3. Mobile SDK¡¯s handle
everything for you
Monday, September 30, 13
#EC2013
Getting started
Monday, September 30, 13
#EC2013
Getting started
Monday, September 30, 13
#EC2013
Getting started
?[EvernoteSession sharedSession]
Monday, September 30, 13
#EC2013
Getting started
?[EvernoteSession sharedSession]
?- (void)authenticateWithViewController:completionHandler:
Monday, September 30, 13
#EC2013
Getting started
?[EvernoteSession sharedSession]
?- (void)authenticateWithViewController:completionHandler:
?[EvernoteUserStore userStore]
Monday, September 30, 13
#EC2013
Getting started
?[EvernoteSession sharedSession]
?- (void)authenticateWithViewController:completionHandler:
?[EvernoteUserStore userStore]
?[EvernoteNoteStore noteStore]
Monday, September 30, 13
#EC2013
Getting started
?[EvernoteSession sharedSession]
?- (void)authenticateWithViewController:completionHandler:
?[EvernoteUserStore userStore]
?[EvernoteNoteStore noteStore]
Monday, September 30, 13
#EC2013
Note
Metadata
Body
Attachments
Monday, September 30, 13
#EC2013
ENML
? Markup language for the body of a note
? Rich content
? Based on XHTML
? Validate against the DTD
Monday, September 30, 13
#EC2013
ENML
Monday, September 30, 13
#EC2013
ENML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note>
<div><en-todo></en-todo>Checkbox 1</div>
<div><en-todo checked="true"></en-todo>Checkbox 2</div>
<div><br clear="none"/></div>
<div><ol><li>Number 1</li><li>Number 2</li></ol></div>
</en-note>
Monday, September 30, 13
#EC2013
ENML
Monday, September 30, 13
#EC2013
ENML
en-note
Monday, September 30, 13
#EC2013
ENML
en-note
en-media
Monday, September 30, 13
#EC2013
ENML
en-note
en-media
en-crypt
Monday, September 30, 13
#EC2013
ENML
en-note
en-media
en-crypt
en-todo
Monday, September 30, 13
#EC2013
Write ENML
Monday, September 30, 13
#EC2013
Write ENML
ENMLWriter - iOS only
Monday, September 30, 13
#EC2013
Write ENML
ENMLWriter - iOS only
(void) writeResource:(EDAMResource *)resource;
Monday, September 30, 13
#EC2013
Write ENML
ENMLWriter - iOS only
(void) writeResource:(EDAMResource *)resource;
(void) writeEncryptedInfo:
(ENEncryptedContentInfo *)encryptedInfo;
Monday, September 30, 13
#EC2013
Write ENML
ENMLWriter - iOS only
(void) writeResource:(EDAMResource *)resource;
(void) writeEncryptedInfo:
(ENEncryptedContentInfo *)encryptedInfo;
(void) writeTodoWithCheckedState:
(BOOL)checkedState;
Monday, September 30, 13
#EC2013
ENML Writer
EDAMData *edamData = [[EDAMData alloc]
initWithBodyHash:dataHash size:myFileData.length
body:myFileData];
EDAMResource* resource = [[EDAMResource alloc] init];
[resource setData:edamData];
[resource setMime:@"image/png"];
ENMLWriter* myWriter = [[ENMLWriter alloc] init]
Monday, September 30, 13
#EC2013
ENML Writer
[myWriter startDocument];
[myWriter startElement:@"span"];
[myWriter startElement:@"br"];
[myWriter endElement];
[myWriter writeResource:resource];
[myWriter endElement];
[myWriter endDocument];
Monday, September 30, 13
#EC2013
View ENML
ENML -> HTML
- (void) convertENMLToHTML:enmlContent completionBlock:
Monday, September 30, 13
#EC2013
Sharing and Business
Monday, September 30, 13
#EC2013
Sharing and Business
? Share notes/notebooks
Monday, September 30, 13
#EC2013
Sharing and Business
? Share notes/notebooks
? Business API
Monday, September 30, 13
#EC2013
Sharing and Business
? Share notes/notebooks
? Business API
? SDK¡¯s help you out
Monday, September 30, 13
#EC2013
Helpful SDK functions
? List notes for a shared notebook
? List all the business notebooks
? Create a business notebook
? Create a note in a business notebook
Monday, September 30, 13
#EC2013
Example - Get all the Post-it?
notes
Monday, September 30, 13
#EC2013
Example - Get all the Post-it?
notes
EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
Monday, September 30, 13
#EC2013
Example - Get all the Post-it?
notes
EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
EDAMNoteFilter* noteFilter = [[EDAMNoteFilter alloc] init];
Monday, September 30, 13
#EC2013
Example - Get all the Post-it?
notes
EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
EDAMNoteFilter* noteFilter = [[EDAMNoteFilter alloc] init];
[noteFilter setWords:@"sourceApplication:postit"];
Monday, September 30, 13
#EC2013
Example - Get all the Post-it?
notes
EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
EDAMNoteFilter* noteFilter = [[EDAMNoteFilter alloc] init];
[noteFilter setWords:@"sourceApplication:postit"];
EDAMNotesMetadataResultSpec* metadataResultSpec =
[[EDAMNotesMetadataResultSpec alloc] init];
Monday, September 30, 13
#EC2013
Example - Get all the Post-it?
notes
EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
EDAMNoteFilter* noteFilter = [[EDAMNoteFilter alloc] init];
[noteFilter setWords:@"sourceApplication:postit"];
EDAMNotesMetadataResultSpec* metadataResultSpec =
[[EDAMNotesMetadataResultSpec alloc] init];
[metadataResultSpec setIncludeTitle:YES];
Monday, September 30, 13
#EC2013
Example - Get all the Post-it?
notes
EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
EDAMNoteFilter* noteFilter = [[EDAMNoteFilter alloc] init];
[noteFilter setWords:@"sourceApplication:postit"];
EDAMNotesMetadataResultSpec* metadataResultSpec =
[[EDAMNotesMetadataResultSpec alloc] init];
[metadataResultSpec setIncludeTitle:YES];
[noteStore ?ndNotesMetadataWithFilter:noteFilter o?set:0 maxNotes:
100 resultSpec:metadataResultSpec success:^(EDAMNotesMetadataList
*metadata)} failure:^(NSError *error) {}];
Monday, September 30, 13
#EC2013
Example - Get all the Post-it?
notes
EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
EDAMNoteFilter* noteFilter = [[EDAMNoteFilter alloc] init];
[noteFilter setWords:@"sourceApplication:postit"];
EDAMNotesMetadataResultSpec* metadataResultSpec =
[[EDAMNotesMetadataResultSpec alloc] init];
[metadataResultSpec setIncludeTitle:YES];
[noteStore ?ndNotesMetadataWithFilter:noteFilter o?set:0 maxNotes:
100 resultSpec:metadataResultSpec success:^(EDAMNotesMetadataList
*metadata)} failure:^(NSError *error) {}];
Monday, September 30, 13
#EC2013
Example - List notes from a
shared notebook
Monday, September 30, 13
#EC2013
Example - List notes from a
shared notebook
EvernoteNoteStore *defaultNoteStore = [EvernoteNoteStore
noteStore];
Monday, September 30, 13
#EC2013
Example - List notes from a
shared notebook
EvernoteNoteStore *defaultNoteStore = [EvernoteNoteStore
noteStore];
[defaultNoteStore listLinkedNotebooksWithSuccess:^(NSArray
*linkedNotebooks) {
Monday, September 30, 13
#EC2013
Example - List notes from a
shared notebook
EvernoteNoteStore *defaultNoteStore = [EvernoteNoteStore
noteStore];
[defaultNoteStore listLinkedNotebooksWithSuccess:^(NSArray
*linkedNotebooks) {
EDAMNoteFilter* noteFilter = [[EDAMNoteFilter alloc] init];
Monday, September 30, 13
#EC2013
Example - List notes from a
shared notebook
EvernoteNoteStore *defaultNoteStore = [EvernoteNoteStore
noteStore];
[defaultNoteStore listLinkedNotebooksWithSuccess:^(NSArray
*linkedNotebooks) {
EDAMNoteFilter* noteFilter = [[EDAMNoteFilter alloc] init];
[defaultNoteStore
listNotesForLinkedNotebook:linkedNotebooks[0]
withFilter:noteFilter success:^(EDAMNoteList *list) { }
failure:^(NSError *error) { }];}
Monday, September 30, 13
#EC2013
Interact with the Evernote app
Monday, September 30, 13
#EC2013
Interact with the Evernote app
1. Create notes
Monday, September 30, 13
#EC2013
Interact with the Evernote app
1. Create notes
2. View a note
Monday, September 30, 13
#EC2013
Interact with the Evernote app
1. Create notes
2. View a note
3. Authentication
Monday, September 30, 13
#EC2013
Interact with the Evernote app
1. Create notes
2. View a note
3. Authentication
4. Intents on Android
Monday, September 30, 13
#EC2013
Wrappers - Local API
Monday, September 30, 13
#EC2013
Wrappers - Local API
- (void)viewNoteInEvernote:
Monday, September 30, 13
#EC2013
Wrappers - Local API
- (void)viewNoteInEvernote:
- (void)saveNewNoteToEvernoteApp:
Monday, September 30, 13
#EC2013
Wrappers - Local API
- (void)viewNoteInEvernote:
- (void)saveNewNoteToEvernoteApp:
Monday, September 30, 13
#EC2013
Open source
Monday, September 30, 13
#EC2013
Open source
Submit pull requests
Monday, September 30, 13
#EC2013
Open source
Submit pull requests
Open issues
Monday, September 30, 13
#EC2013
Open source
Submit pull requests
Open issues
Github.com/evernote
Monday, September 30, 13
#EC2013
Popular apps
Pocket Lightly
Monday, September 30, 13
#EC2013
Popular apps
Dolphin Browser
Monday, September 30, 13
#EC2013
Thank you!
mustafa@evernote.com
Questions?
Monday, September 30, 13

More Related Content

EC3 Workshop - Evernote API with Mobile SDKs