无法在 cordova 应用程序中与 evernote api 共享笔记

Couldn't share note with evernote api in cordova app

基于 evernote-sdk-js 的缩小版本,在 phonegap 应用程序中,我能够使用 noteStore 检索笔记列表。 获取NoteStore的函数:

createNoteStore : function(options) {
                    var noteStoreURL = options.edam_noteStoreUrl;
                    var noteStoreTransport = new Thrift.BinaryHttpTransport(
                            noteStoreURL);
                    var noteStoreProtocol = new Thrift.BinaryProtocol(
                            noteStoreTransport);
                    return new NoteStoreClient(noteStoreProtocol);
                };

有了这个功能,我可以得到笔记列表

function getList(){
                                    var $callback = $.Deferred();
                    createNoteStore(params).listNotebooks(
                            params.oauth_token, function
   onSuccess(notebooks) {
                                $callback.resolve(notebooks);
                            }, function onerror(error) {
                                $callback.reject(notebooks);
                            });
                    return $callback;
}

现在我希望通过使用 'findNotesMetadata' 和 findNotes 来分享单个笔记或搜索带有某些关键词的笔记,其中 none 与 EDAMUserException {错误代码:3,参数:"authenticationToken"}

function Search(word, options, params){
                                    var $callback = $.Deferred();
                    if (!params) {
                        throw new Error('missing required parametres');
                    }
                    var filter = new NoteFilter();
                    filter.words = 'notebook:' + word + ' ';
                    var spec = new NotesMetadataResultSpec();
                    spec.includeTitle = true;
                    // if !options.noteStore && !
                    // create
                    api.createNoteStore(params).findNotes(
                    params.oauth_token, filter, 0, 100, spec,
                            function onSuccess(notebooks) {
                                $callback.resolve(notebooks);
                            }, function onerror(error) {
                                $callback.reject(error);
                            });
                    return $callback;
}

errorCode:3 PERMISSION_DENIED so it's probably because you don't have permission on your API key. With basic access, you can list notebooks but if you want to access your notes, you need full access. See this page 关于权限。

您可以在 OAuth 过程中检查您的 API 密钥的权限。如果是这种情况,重新创建具有完全权限的 API 密钥将解决您的问题。