SlideShare a Scribd company logo
Evernote iOS SDK
introduction
GoLater Developer MaoYang
Twitter @GoLaterApp E-Mail my@esast.com
About Me
• 5 years Mac Device Driver/Application developer
• 10 years Enterprise grade software development
tools consultant
• Now -> iOS/Android app developer
Today’s Goal
• iOS App development setup -> Xcode 5.x +
Cocoapods
• Evernote iOS SDK introduction
• 5 Evernote iOS SDK practices
Evernote SDK
• https://github.com/evernote/evernote-sdk-ios
• Evernote Cloud SDK detail spec ->http://
dev.evernote.com
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
Practice-1 SDK setup &
OAuth
• Xcode 5.x +
• cocoapods installation—> sudo gem install
cocoapods
• Create an iOS project named EasyShare by Xcode
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
Setup URL Scheme
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];!
}
Initialize SDK -2
(BOOL)application:(UIApplication *)application openURL:(NSURL
*)url sourceApplication:(NSString *)sourceApplication annotation:
(id)annotation {!
BOOL canHandle = NO;!
if ([[NSString stringWithFormat:@"en-%@", [[EvernoteSession
sharedSession] consumerKey]] isEqualToString:[url scheme]] ==
YES) {!
canHandle = [[EvernoteSession sharedSession]
canHandleOpenURL:url];!
}!
return canHandle;!
}
Initialize SDK-3
- (void)applicationDidBecomeActive:(UIApplication
*)application!
{!
// Restart any tasks that were paused (or not yet
started) while the application was inactive. If the
application was previously in the background, optionally
refresh the user interface.!
[[EvernoteSession sharedSession]
handleDidBecomeActive];!
}
SingleTon need to know in
this practice
• [EvernoteSession sharedSession], responsible
for login/logout, login status
UI would look like
OAuth
• if(![[EvernoteSession sharedSession]
isAuthenticated){}
• [[EvernoteSession sharedSession]
authenticateWithViewController:self
completionHandler:^(NSError *error){}]
Sample code
• http://goo.gl/KzUK8W
Practice-2 List all of your
own notebooks
SingleTon & Class need to
know in this practice
!
• [EvernoteStore noteStore] -> For ever note
related operation
• EDAMNotebook -> Class of Notebook object
Query Notebook
• [[EvernoteNotesStore noteStore]
listNotebooksWithSuccess:^(NSArray *notebooks){
for(EDAMNotebook *notebook in notebooks){} }
failure:^(NSError *error){}];
Sample code
• http://goo.gl/I9fNpb
Practice-3 List all of notes in
a notebook
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
Filter
• EDAMNoteFilter *filter = [[EDAMNoteFilter alloc]
initWithOrder:NoteSortOrder_UPDATED
ascending:NO words:nil notebookGuid:nil
tagGuid:nil timeZone:nil inActive:NO
emphasized:NO]
• Filter full api spec doucment—>http://
dev.evernote.com/doc/reference/
NoteStore.html#Struct_NoteFilter
Metadata fields
• EDAMNotesMetadataResultSpec *resultSpec =
[[EDAMNotesMetadataResultSpec alloc]
initWithIncludeTitle:YES
includeContentLength:YES includeCreated:YES
includeUpdated:YES includeDeleted:YES
includeUpdateSequenceNum:YES
includeNotebookGuid:YES includeTagGuids:YES
includeAttributes:YES
includeLargestResourceMime:NO
includeLargestResourceSize:YES];
Query
• [[EvernoteNoteStore noteStore]
findNotesMetadataWithFilter:filter offset:0
maxNotes:10 resultSpec:resultSpec
success:^(EDAMNotesMetadataList *metalist)
{if(metalist.notes.count > 0)….}failure:^(NSError
*error){ } ];
Sample code
• http://goo.gl/D2G3G6
Practice-4 Render note
content in UIWebView
Classes need to know in this
practice
• ENMLUtility->Convert ENML to HTML
• EDAMNote -> Class of note object
Download note content
• [[EDAMNoteStore noteStore]
getNoteWithGuid:note.guid withContent:YES
withResourcesData:YES
withResourceRecognition:NO
withResourceAlternateData:NO
success:^(EDAMNote *note){} failure:^(NSError
*error{}]
ENML->HTML
• ENMLUtility *utility = [[ENMLUtility alloc] init]
• [utilty convertENMLToHTML:note.content
withResources:note.resources
completion:^(NSString *html,NSError *error){}
Sample code
• http://goo.gl/tUzfQH
Practice-5 Share note to Social network
setup pod would use in this
practice
• pod ‘LINEActivity’, ‘~>0.2’
• pod update
Classes need to know in this
practice
• [EvernoteUserStore userStore], For fetching user
related information like shardid
• EDAMUser Class of user object
Sharing note URL
generated by Evernote
• http://www.evernote.com/shard/{shardid}/sh/
{noteguid}/{notekey}
How to get user’s shard id?
• [[EvernoteUserStore userStore]
getUserWithSuccess:^(EDAMUser *user){}
failure:^(NSError *error){ NSString *shardId =
user.shardId}];
Share note then get note’s
sharing key
• [[EvernoteNoteStore noteStore]
shareNoteWithGuid:note.guid success:^(NSString
*key){} failure:^(NSError *error){}]
iOS Share Activity for note
sharing url
• NSURL *shareURL = [NSURL
URLWithString:shareurlstr]
• NSArray *activityItems = @[shareurlstr,shareURL]
• NSArray *applicationActivities = @[[LINEActivity alloc]
init]
• UIActivityViewController *activity =
[[UIActivityViewController alloc]
initWithActivityItems:activityItems
applicationActivities:applicationActivities]
Sample code
• http://goo.gl/wGXMrb
Share some of My
experience …
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?
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
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
Notebook
• User’s own Notebook->EDAMNotebook
• Notebook shared by friend ->EDAMLinkbook
• Business Notebook
• Take care about differences between each
notebook interface
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
Q & A

More Related Content

Similar to EverNote iOS SDK introduction & practices

Practical JavaScript Programming - Session 8/8
Practical JavaScript Programming - Session 8/8Practical JavaScript Programming - Session 8/8
Practical JavaScript Programming - Session 8/8
Wilson Su
 
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Formacion en movilidad: Conceptos de desarrollo en iOS (I) Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Mobivery
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical StuffPetr Dvorak
 
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Sarp Erdag
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS DevelopmentJussi Pohjolainen
 
Jaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social WebJaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social Web
Patrick Chanezon
 
Android Workshop 2013
Android Workshop 2013Android Workshop 2013
Android Workshop 2013
Junda Ong
 
How to Build & Develop Responsive Open Learning Environments with the ROLE SDK
How to Build & Develop Responsive Open Learning Environments with the ROLE SDKHow to Build & Develop Responsive Open Learning Environments with the ROLE SDK
How to Build & Develop Responsive Open Learning Environments with the ROLE SDK
Dominik Renzel
 
React nativebeginner1
React nativebeginner1React nativebeginner1
React nativebeginner1
Oswald Campesato
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
Matteo Manchi
 
Google Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocialGoogle Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocial
Patrick Chanezon
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsPetr Dvorak
 
iOS5 NewStuff
iOS5 NewStuffiOS5 NewStuff
iOS5 NewStuff
deenna_vargilz
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud Castles
Ben Scofield
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
WO Community
 
Real World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsReal World Asp.Net WebApi Applications
Real World Asp.Net WebApi Applications
Effie Arditi
 
Cross platform mobile development
Cross platform mobile development Cross platform mobile development
Cross platform mobile development
Alberto De Bortoli
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
Junda Ong
 
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
Sencha
 

Similar to EverNote iOS SDK introduction & practices (20)

Practical JavaScript Programming - Session 8/8
Practical JavaScript Programming - Session 8/8Practical JavaScript Programming - Session 8/8
Practical JavaScript Programming - Session 8/8
 
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Formacion en movilidad: Conceptos de desarrollo en iOS (I) Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
 
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
 
Jaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social WebJaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social Web
 
appledoc_style
appledoc_styleappledoc_style
appledoc_style
 
Android Workshop 2013
Android Workshop 2013Android Workshop 2013
Android Workshop 2013
 
How to Build & Develop Responsive Open Learning Environments with the ROLE SDK
How to Build & Develop Responsive Open Learning Environments with the ROLE SDKHow to Build & Develop Responsive Open Learning Environments with the ROLE SDK
How to Build & Develop Responsive Open Learning Environments with the ROLE SDK
 
React nativebeginner1
React nativebeginner1React nativebeginner1
React nativebeginner1
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
Google Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocialGoogle Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocial
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
 
iOS5 NewStuff
iOS5 NewStuffiOS5 NewStuff
iOS5 NewStuff
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud Castles
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
 
Real World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsReal World Asp.Net WebApi Applications
Real World Asp.Net WebApi Applications
 
Cross platform mobile development
Cross platform mobile development Cross platform mobile development
Cross platform mobile development
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
 

Recently uploaded

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

EverNote iOS SDK introduction & practices

  • 1. Evernote iOS SDK introduction GoLater Developer MaoYang Twitter @GoLaterApp E-Mail my@esast.com
  • 2. About Me • 5 years Mac Device Driver/Application developer • 10 years Enterprise grade software development tools consultant • Now -> iOS/Android app developer
  • 3. Today’s Goal • iOS App development setup -> Xcode 5.x + Cocoapods • Evernote iOS SDK introduction • 5 Evernote iOS SDK practices
  • 4. Evernote SDK • https://github.com/evernote/evernote-sdk-ios • Evernote Cloud SDK detail spec ->http:// dev.evernote.com
  • 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];! }
  • 10. Initialize SDK -2 (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation: (id)annotation {! BOOL canHandle = NO;! if ([[NSString stringWithFormat:@"en-%@", [[EvernoteSession sharedSession] consumerKey]] isEqualToString:[url scheme]] == YES) {! canHandle = [[EvernoteSession sharedSession] canHandleOpenURL:url];! }! return canHandle;! }
  • 11. Initialize SDK-3 - (void)applicationDidBecomeActive:(UIApplication *)application! {! // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.! [[EvernoteSession sharedSession] handleDidBecomeActive];! }
  • 12. SingleTon need to know in this practice • [EvernoteSession sharedSession], responsible for login/logout, login status
  • 14. OAuth • if(![[EvernoteSession sharedSession] isAuthenticated){} • [[EvernoteSession sharedSession] authenticateWithViewController:self completionHandler:^(NSError *error){}]
  • 16. Practice-2 List all of your own notebooks
  • 17. SingleTon & Class need to know in this practice ! • [EvernoteStore noteStore] -> For ever note related operation • EDAMNotebook -> Class of Notebook object
  • 18. Query Notebook • [[EvernoteNotesStore noteStore] listNotebooksWithSuccess:^(NSArray *notebooks){ for(EDAMNotebook *notebook in notebooks){} } failure:^(NSError *error){}];
  • 20. Practice-3 List all of notes in a notebook
  • 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
  • 22. Filter • EDAMNoteFilter *filter = [[EDAMNoteFilter alloc] initWithOrder:NoteSortOrder_UPDATED ascending:NO words:nil notebookGuid:nil tagGuid:nil timeZone:nil inActive:NO emphasized:NO] • Filter full api spec doucment—>http:// dev.evernote.com/doc/reference/ NoteStore.html#Struct_NoteFilter
  • 23. Metadata fields • EDAMNotesMetadataResultSpec *resultSpec = [[EDAMNotesMetadataResultSpec alloc] initWithIncludeTitle:YES includeContentLength:YES includeCreated:YES includeUpdated:YES includeDeleted:YES includeUpdateSequenceNum:YES includeNotebookGuid:YES includeTagGuids:YES includeAttributes:YES includeLargestResourceMime:NO includeLargestResourceSize:YES];
  • 24. Query • [[EvernoteNoteStore noteStore] findNotesMetadataWithFilter:filter offset:0 maxNotes:10 resultSpec:resultSpec success:^(EDAMNotesMetadataList *metalist) {if(metalist.notes.count > 0)….}failure:^(NSError *error){ } ];
  • 27. Classes need to know in this practice • ENMLUtility->Convert ENML to HTML • EDAMNote -> Class of note object
  • 28. Download note content • [[EDAMNoteStore noteStore] getNoteWithGuid:note.guid withContent:YES withResourcesData:YES withResourceRecognition:NO withResourceAlternateData:NO success:^(EDAMNote *note){} failure:^(NSError *error{}]
  • 29. ENML->HTML • ENMLUtility *utility = [[ENMLUtility alloc] init] • [utilty convertENMLToHTML:note.content withResources:note.resources completion:^(NSString *html,NSError *error){}
  • 31. Practice-5 Share note to Social network
  • 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){}]
  • 37. iOS Share Activity for note sharing url • NSURL *shareURL = [NSURL URLWithString:shareurlstr] • NSArray *activityItems = @[shareurlstr,shareURL] • NSArray *applicationActivities = @[[LINEActivity alloc] init] • UIActivityViewController *activity = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities]
  • 39. Share some of My experience …
  • 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
  • 46. Q & A