草庐IT

iphone - 我想通过我们的应用程序将一些数据存储在 "EverNote"中

coder 2024-01-20 原文

我想通过我们的应用程序(图像或文本或两者)将一些数据存储在“EverNote”中。

我用谷歌搜索,我得到了一些指导,比如 EverNote SDK,我也得到了 EverNoteCounter 示例(当我运行它时,当我单击 getCount 按钮时,它会显示一条警告消息“无法验证”)。 我还生成了开发人员 token 。

但我无法创建 consumerKey、consumerSecret。而且我也没有找到如何将我们的数据从我们的应用程序存储到 evernote。

我得到了一些链接,例如 this一个

但是当我浏览那个链接时它说(这个 URL 不支持 HTTP 方法 GET)

我能够通过 EVERNOTE 进行身份验证,并且能够获得该帐户中的笔记本数量。

我在我的应用程序中使用了 sqllite。我正在为图像使用一个文件夹。 Sqllite 有图像链接信息。

如何存储数据。

我使用以下代码进行身份验证并获取计数

    - (IBAction)retrieveUserNameAndNoteCount:(id)sender
{
    // Create local reference to shared session singleton
    EvernoteSession *session = [EvernoteSession sharedSession];
    [session authenticateWithViewController:self completionHandler:^(NSError *error) {
        // Authentication response is handled in this block
        if (error || !session.isAuthenticated) {
            // Either we couldn't authenticate or something else went wrong - inform the user
            if (error) {
                NSLog(@"Error authenticating with Evernote service: %@", error);
            }
            if (!session.isAuthenticated) {
                NSLog(@"User could not be authenticated.");
            }
            UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Error" 
                                                             message:@"Could not authenticate" 
                                                            delegate:nil 
                                                   cancelButtonTitle:@"OK" 
                                                   otherButtonTitles:nil] autorelease];
            [alert show];
        } else {
            // We're authenticated!
            EvernoteUserStore *userStore = [EvernoteUserStore userStore];
            // Retrieve the authenticated user as an EDAMUser instance
            [userStore getUserWithSuccess:^(EDAMUser *user) {
                // Set usernameField (UILabel) text value to username
                [usernameField setText:[user username]];
                // Retrieve total note count and display it
                [self countAllNotesAndSetTextField];                
            } failure:^(NSError *error) {
                NSLog(@"Error retrieving authenticated user: %@", error);
            }];
        } 
    }];    
}

- (void)countAllNotesAndSetTextField
{
    // Allow access to this variable within the block context below (using __block keyword)
    __block int noteCount = 0;

    EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore];
    [noteStore listNotebooksWithSuccess:^(NSArray *notebooks) {
        for (EDAMNotebook *notebook in notebooks) {
            if ([notebook guid]) {
                EDAMNoteFilter *filter = [[EDAMNoteFilter alloc] init];
                [filter setNotebookGuid:[notebook guid]];
                [noteStore findNoteCountsWithFilter:filter withTrash:NO success:^(EDAMNoteCollectionCounts *counts) {
                    if (counts) {

                        // Get note count for the current notebook and add it to the displayed total
                        NSNumber *notebookCount = (NSNumber *)[[counts notebookCounts] objectForKey:[notebook guid]];
                        noteCount = noteCount + [notebookCount intValue];
                        NSString *noteCountString = [NSString stringWithFormat:@"%d", noteCount];
                        [noteCountField setText:noteCountString];
                    }
                } failure:^(NSError *error) {
                    NSLog(@"Error while retrieving note counts: %@", error);
                }];
            }
        }        
    } failure:^(NSError *error) {
        NSLog(@"Error while retrieving notebooks: %@", error);
    }];
}

请给我建议链接或给我指导

提前致谢

最佳答案

当您只需要访问自己的帐户时,将使用开发者 token 。要获取消费者 key / secret ,请转到此处:http://dev.evernote.com/documentation/cloud/ .

如果您使用的是 iOS,https://github.com/evernote/evernote-sdk-ios有一个示例应用程序,您可以在拥有使用者 key 和 secret 后使用。

一般而言,dev.evernote.com 上有很多信息。

所有 SDK 都位于 https://github.com/evernote

iOS 入门指南:http://blog.evernote.com/tech/2012/05/24/evernote-sdk-integration-ios/

关于iphone - 我想通过我们的应用程序将一些数据存储在 "EverNote"中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14052708/

有关iphone - 我想通过我们的应用程序将一些数据存储在 "EverNote"中的更多相关文章

  1. ruby-on-rails - rails : "missing partial" when calling 'render' in RSpec test - 2

    我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou

  2. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  3. ruby - 将差异补丁应用于字符串/文件 - 2

    对于具有离线功能的智能手机应用程序,我正在为Xml文件创建单向文本同步。我希望我的服务器将增量/差异(例如GNU差异补丁)发送到目标设备。这是计划:Time=0Server:hasversion_1ofXmlfile(~800kiB)Client:hasversion_1ofXmlfile(~800kiB)Time=1Server:hasversion_1andversion_2ofXmlfile(each~800kiB)computesdeltaoftheseversions(=patch)(~10kiB)sendspatchtoClient(~10kiBtransferred)Cl

  4. ruby - 解析 RDFa、微数据等的最佳方式是什么,使用统一的模式/词汇(例如 schema.org)存储和显示信息 - 2

    我主要使用Ruby来执行此操作,但到目前为止我的攻击计划如下:使用gemsrdf、rdf-rdfa和rdf-microdata或mida来解析给定任何URI的数据。我认为最好映射到像schema.org这样的统一模式,例如使用这个yaml文件,它试图描述数据词汇表和opengraph到schema.org之间的转换:#SchemaXtoschema.orgconversion#data-vocabularyDV:name:namestreet-address:streetAddressregion:addressRegionlocality:addressLocalityphoto:i

  5. ruby - 通过 rvm 升级 ruby​​gems 的问题 - 2

    尝试通过RVM将RubyGems升级到版本1.8.10并出现此错误:$rvmrubygemslatestRemovingoldRubygemsfiles...Installingrubygems-1.8.10forruby-1.9.2-p180...ERROR:Errorrunning'GEM_PATH="/Users/foo/.rvm/gems/ruby-1.9.2-p180:/Users/foo/.rvm/gems/ruby-1.9.2-p180@global:/Users/foo/.rvm/gems/ruby-1.9.2-p180:/Users/foo/.rvm/gems/rub

  6. ruby - 检查 "command"的输出应该包含 NilClass 的意外崩溃 - 2

    为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar

  7. ruby-on-rails - Rails 应用程序之间的通信 - 2

    我构建了两个需要相互通信和发送文件的Rails应用程序。例如,一个Rails应用程序会发送请求以查看其他应用程序数据库中的表。然后另一个应用程序将呈现该表的json并将其发回。我还希望一个应用程序将存储在其公共(public)目录中的文本文件发送到另一个应用程序的公共(public)目录。我从来没有做过这样的事情,所以我什至不知道从哪里开始。任何帮助,将不胜感激。谢谢! 最佳答案 无论Rails是什么,几乎所有Web应用程序都有您的要求,大多数现代Web应用程序都需要相互通信。但是有一个小小的理解需要你坚持下去,网站不应直接访问彼此

  8. ruby - 无法运行 Rails 2.x 应用程序 - 2

    我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby​​:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r

  9. ruby - 通过 erb 模板输出 ruby​​ 数组 - 2

    我正在使用puppet为ruby​​程序提供一组常量。我需要提供一组主机名,我的程序将对其进行迭代。在我之前使用的bash脚本中,我只是将它作为一个puppet变量hosts=>"host1,host2"我将其提供给bash脚本作为HOSTS=显然这对ruby​​不太适用——我需要它的格式hosts=["host1","host2"]自从phosts和putsmy_array.inspect提供输出["host1","host2"]我希望使用其中之一。不幸的是,我终其一生都无法弄清楚如何让它发挥作用。我尝试了以下各项:我发现某处他们指出我需要在函数调用前放置“function_”……这

  10. ruby-on-rails - Rails 应用程序中的 Rails : How are you using application_controller. rb 是新手吗? - 2

    刚入门rails,开始慢慢理解。有人可以解释或给我一些关于在application_controller中编码的好处或时间和原因的想法吗?有哪些用例。您如何为Rails应用程序使用应用程序Controller?我不想在那里放太多代码,因为据我了解,每个请求都会调用此Controller。这是真的? 最佳答案 ApplicationController实际上是您应用程序中的每个其他Controller都将从中继承的类(尽管这不是强制性的)。我同意不要用太多代码弄乱它并保持干净整洁的态度,尽管在某些情况下ApplicationContr

随机推荐