Git Product home page Git Product logo

algs's Introduction

Evernote SDK for iOS version 0.2.1

What this is

A pleasant iOS-wrapper around the Evernote Cloud API (v1.22), using OAuth for authentication.

Required reading

Please check out the Evernote Developers portal page.

Installing

Register for an Evernote API key (and secret)

You can do this on the Evernote Developers portal page.

Include the code

You have a few options:

  • Copy the evernote-sdk-ios source code into your Xcode project.
  • Add the evernote-sdk-ios xcodeproj to your project/workspace.
  • Build the evernote-sdk-ios as a static library and include the .h's and .a.
  • Use cocoapods, a nice Objective-C dependency manager. Our pod name is "Evernote-SDK-iOS".

Link with frameworks

evernote-sdk-ios depends on Security.framework, so you'll need to add that to any target's "Link Binary With Libraries" Build Phase.

Modify your AppDelegate

First you set up the shared EvernoteSession, configuring it with your consumer key and secret. Do something like this in your AppDelegate's application:didFinishLaunchingWithOptions: method.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Initial development is done on the sandbox service
    // Change this to @"www.evernote.com" to use the production Evernote service
    NSString *EVERNOTE_HOST = @"sandbox.evernote.com";

    // 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];    
}

Now you're good to go.

Using the Evernote SDK from your code

Authenticate

Somewhere in your code, you'll need to authenticate the EvernoteSession, passing in your view controller.

A normal place to do this would be a "link to Evernote" button action.

EvernoteSession *session = [EvernoteSession sharedSession];
[session authenticateWithViewController:self completionHandler:^(NSError *error) {
    if (error || !session.isAuthenticated) {
        // authentication failed :(
        // show an alert, etc
        // ...
    } else {
        // authentication succeeded :)
        // do something now that we're authenticated
        // ... 
    } 
}];

Calling authenticateWithViewController:completionHandler: will start the OAuth process. EvernoteSession will open a new modal view controller, to display Evernote's OAuth web page and handle all the back-and-forth OAuth handshaking. When the user finishes this process, Evernote's modal view controller will be dismissed.

Use EvernoteNoteStore and EvernoteUserStore for asynchronous calls to the Evernote API

Both EvernoteNoteStore and EvernoteUserStore have a convenience constructor that uses the shared EvernoteSession.
All API calls are asynchronous, occurring on a background GCD queue. You provide the success and failure callback blocks. E.g.,

EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
[noteStore listNotebooksWithSuccess:^(NSArray *notebooks) {
                                // success... so do something with the returned objects
                                NSLog(@"notebooks: %@", notebooks);
                            }
                            failure:^(NSError *error) {
                                // failure... show error notification, etc
                                NSLog(@"error %@", error);                                            
                            }];

Full information on the Evernote NoteStore and UserStore API is available on the Evernote Developers portal page.

FAQ

Does the Evernote SDK support ARC?

Not yet.

What if I want to do my own Evernote Thrift coding?

EvernoteNoteStore and EvernoteUserStore are an abstraction layer on top of Thrift, and try to keep some of that nastiness out of your hair. You can still get access to the underlying Thrift client objects, though: check out EvernoteSession's userStore and noteStore properties.


Sobre o agendatech

Organizando os eventos, conferencias, dojos, hora-extras pelo Brasil

Procurando um evento de tecnologia?

Buscando os próximos eventos de tecnologia e quer sempre estar aprendendo mais? Uma das melhores fontes de novos conhecimentos e aprendizagem vem da participação em eventos. Conhecendo pessoas, conversando sobre tecnologia, expandindo as idéias e melhorando o networking.

O mercado de tecnologia no Brasil está em alta e mostra uma diversidade muito grande além de estar presente em diversas regiões do país. Talvez o mais complicado seja se organizar e chegar em um lugar novo e saber o que acontece naquela região. Independentemente da época do ano, sempre estamos envolvidos e comentando sobre os eventos que estão acontecendo. Agora você tem um lugar para facilitar o networking, ajudando todos a encontrar eventos. E não importa onde, se estiver acontecendo um evento perto de você, com certeza você vai saber. O Agendatech é um site que busca trazer os eventos de tecnologias, das mais diversas áreas, para que as pessoas envolvidas com tecnologia possam evoluir cada vez mais.

Caso você tenha um evento, e queira divulgá-lo, você também está no lugar certo. Esteja você envolvido em algum evento como palestrante, organizador ou platéia você pode cadastrar os eventos.

Colabore!, clique aqui e cadastre. E lembre-se! Não importa o tamanho, temos muito orgulho de divulgar todos encontros tecnólogicos, por exemplo: dojos, encontros de grupos de usuários, #hora's extras, workshops, conferências, aulas abertas, desconferências, etc...

Não perca tempo, nos ajude a mapear os eventos Brasil à fora e fazer com que mais pessoas possam participar das conferências tecnólogicas.

Eventos por estado.

O Agendatech permite a busca por estado, informando em ordem decrescente os eventos do ano.

Quer saber o que vai rolar esse mês?

Busque pelo mês no Agendatech e saiba o que está acontecendo no Brasil nesse mês.

Saiba o que está em alta sobre tecnologia no momento.

Uma nuvem de tags de eventos mostra o que mais vem chamando a atenção nos eventos pelo Brasil. É uma ótima forma de você saber o que precisa estar atento e o que está em alta no Brasil.

Acompanhe o que a galera fala no twitter.

Acompanhe as pessoas que participam dos eventos e conheça mais gente, uma ótima oportunidade de networking.

algs's People

Contributors

alessandrovpic avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.