Skip to content

Instantly share code, notes, and snippets.

@evernotegists
Created May 25, 2013 05:09
Show Gist options
  • Save evernotegists/5647972 to your computer and use it in GitHub Desktop.
Save evernotegists/5647972 to your computer and use it in GitHub Desktop.
Get user example
- (void)getUserExample {
[[EvernoteUserStore userStore] getUserWithSuccess:^(EDAMUser *user) {
int64_t totalMonthlyQuota = [[user accounting] uploadLimit];
[[EvernoteNoteStore noteStore] getSyncStateWithSuccess:^(EDAMSyncState *syncState) {
int64_t usedSoFar = [syncState uploaded];
int64_t quotaRemaining = totalMonthlyQuota - usedSoFar;
NSDate* resetDate =[NSDate
endateFromEDAMTimestamp:[[user accounting] uploadLimitEnd]];
NSLog(@"Quota remaining : %lld , reset date : %@",quotaRemaining,resetDate);
} failure:^(NSError *error) {
NSLog(@"Error : %@",error);
}];
} failure:^(NSError *error) {
NSLog(@"Error : %@",error);
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment