我想通过我们的应用程序(图像或文本或两者)在“EverNote”中存储一些数据。
我用谷歌搜索,我得到了一些指导,比如 EverNote SDK,我也得到了 EverNoteCounter 示例(当我运行这个时,当我点击 getCount 按钮时,它会显示一条警告消息“无法验证”)。我也生成了开发者令牌。
但我无法创建consumerKey、consumerSecret。而且我也没有找到如何将我们的数据从我们的应用程序存储到印象笔记。
我有一些像这样的链接
但是当我通过该链接时,它说(此 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);
}];
}
请建议我链接或给我指导
非常感谢提前