Thursday, 15 September 2011

objective c - Google Drive iOS SDK: Getting user's space available -



objective c - Google Drive iOS SDK: Getting user's space available -

i building app uses google drive ios sdk upload files user's google drive account. due size of files beingness uploaded, know how much space user using , has available. illustration plan have label in app shows user using 10gb/100gb currently.

i guessing there way grab info initial log in, info on fly.

thanks in advance!

you can query resource info. docs includes sample code well: https://developers.google.com/drive/v2/reference/about/get

#import "gtldrive.h" // ... + (void)printaboutwithservice:(gtlservicedrive *)service { gtlquerydrive *query = [gtlquerydrive queryforaboutget]; // queryticket can used track status of request. gtlserviceticket *queryticket = [service executequery:query completionhandler:^(gtlserviceticket *ticket, gtldriveabout *about, nserror *error) { if (error == nil) { nslog(@"current user name: %@", about.name); nslog(@"root folder id: %@", about.rootfolderid); nslog(@"total quota (bytes): %@", about.quotabytestotal); nslog(@"used quota (bytes): %@", about.quotabytesused); } else { nslog(@"an error occurred: %@", error); } }]; } // ...

ios objective-c google-drive-sdk

No comments:

Post a Comment