1
我想實現印象筆記,我需要登錄並獲取筆記本列表。我在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);
}];
}
我得到EDAMUser作爲零,我也希望所有的筆記本列表,以及,任何幫助將是巨大的。
任何人都可以建議我我要去哪裏錯了..!? –