Search code examples
iosrubymotionevernote

Searching notes using Evernote iOS sdk


I´m building an app on top of evernote-ios-sdk using ruby-motion. I can create tags and notes but when I try to do a search I get the error: domain=com.evernote.sdk, code=3 (EDAMErrorCode_PERMISSION_DENIED?). Is this a permission problem or a code problem? Below is my code with and without a resultSpec.

    note_store = EvernoteNoteStore.noteStore
    filter = EDAMNoteFilter.alloc.initWithOrder 0, ascending:false, words:nil, notebookGuid:nil, tagGuids:nil, timeZone:nil, inactive:false, emphasized:nil
    note_store.findNotesWithFilter filter, offset:0, maxNotes:10, success: notes_loaded, failure: output_error

    spec = EDAMNotesMetadataResultSpec.alloc.initWithIncludeTitle false, includeContentLength:false, includeCreated:false, includeUpdated:false, includeUpdateSequenceNum:false, includeNotebookGuid:false, includeTagGuids:false, includeAttributes:false, includeLargestResourceMime:false, includeLargestResourceSize:false
    note_store.findNotesMetadataWithFilter filter, offset:0, maxNotes:10, resultSpec:spec, success: notes_loaded, failure: output_error

Solution

  • When you created your API key, you probably asked for Basic access. You need full access to read notes. More info here. You can change it to full access here.