2017-04-06 3 views
1

私はEvernoteを実装しようとしています。ログインしてノートブックリストを取得する必要があります。私は、私がnilとしてEDAMUserを取得していますし、私も同様に、すべてのノートブックのリストが欲しい...次のコードShowuserinfo方法でノートブックリストの認証と取得Evernote iOS目的C

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); 
    }]; 
} 

を実装しました。、任意のヘルプは素晴らしいものです。

+0

は誰がどこで間違ったつもりだ私を提案することができますか..!? –

答えて

関連する問題