【问题标题】:authenticating and getting notebook list Evernote iOS Objective C验证和获取笔记本列表 Evernote iOS Objective C
【发布时间】:2017-09-01 14:14:31
【问题描述】:

我正在尝试实现 Evernote,我需要登录并获取笔记本列表。我实现了以下代码..

   ENSession *session = [ENSession sharedSession];
    [[ENSession sharedSession] authenticateWithViewController:self preferRegistration:NO completion:^(NSError *authenticateError) {


    if (authenticateError || !session.isAuthenticated) {
        NSLog(@"Error : %@",authenticateError);
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                        message:@"Could not authenticate"
                                                       delegate:nil
                                              cancelButtonTitle:@"OK"
                                              otherButtonTitles:nil];
        [alert show];
    } else {
        [self updateButtonsForAuthentication];
    }

}];

- (void)updateButtonsForAuthentication
{
    ENSession *session = [ENSession sharedSession];

    if (session.isAuthenticated) {
        [self showUserInfo];
    } else {

    }
}

- (void)showUserInfo
{
    ENUserStoreClient *userStore = [[ENUserStoreClient alloc]init];
    [userStore fetchUserWithCompletion:^(EDAMUser *  user, NSError * _Nullable error) {
        NSLog(@"%@",user);
        NSLog(@"%@",user.username);
    }];
}

在 Showuserinfo 方法中,我将 EDAMUser 设为 nil,我也想要所有笔记本列表。任何帮助都会很棒。

【问题讨论】:

  • 谁能告诉我我哪里出错了..!?

标签: ios xcode evernote


【解决方案1】:

您是否导入了:

#import <ENSDK/Advanced/ENSDKAdvanced.h>

如果您尚未阅读,此参考资料可能会对您有所帮助: https://github.com/evernote/evernote-cloud-sdk-ios/blob/master/Working_with_the_Advanced_(EDAM)_API.md

【讨论】:

    猜你喜欢
    • 2017-10-31
    • 1970-01-01
    • 1970-01-01
    • 2014-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多