Google Drive API for Objective-C return some file not all

333 views
Skip to first unread message

Narong Aunthee

unread,
Jul 4, 2016, 7:23:42 AM7/4/16
to Google APIs Client Library for Objective-C

I'm implementing Google Drive Api for my mac application using Google API Client for REST Library below,

- (void)fetchFileList {

_fileList = nil;
_fileListFetchError = nil;


GTLRDriveService *service = self.service;

GTLRDriveQuery_FilesList *query = [GTLRDriveQuery_FilesList query];

// Because GTLRDrive_FileList is derived from GTLCollectionObject and the service
// property shouldFetchNextPages is enabled, this may do multiple fetches to
// retrieve all items in the file list.


query.fields = @"kind,nextPageToken,files(mimeType,id,kind,name,webViewLink,thumbnailLink,trashed)";



_fileListTicket = [service executeQuery:query
                      completionHandler:^(GTLRServiceTicket *callbackTicket,
                                          GTLRDrive_FileList *fileList,
                                          NSError *callbackError) {
                          // Callback
                          _fileList = fileList;
                          _fileListFetchError = callbackError;
                          _fileListTicket = nil;



                          NSLog(@"%@", fileList);


                      }];
}

Here the return value

GTLRDrive_FileList 0x6080002404e0: {kind:"drive#fileList" files:[5]}

There are 7 items on my drive but it returns only 5 items?

Thomas Van Lenten

unread,
Jul 8, 2016, 5:47:33 PM7/8/16
to Google APIs Client Library for Objective-C
I'm no expert on Drive, but taking a peek at some of the docs: https://developers.google.com/drive/v3/reference/files/list

I think it may come down to what are the items on Drive for you.  There is a "corpus" parameter, that defaults to "user", if any are "domain" specific they could be left out.  There isn't much detail there, but the "spaces" parameter could also come into play.

That docs page also lets you do queries locally to play with things to see how they change the results, so you might try using that to see how they apply.

Also, the drive documentation has a section for support (https://developers.google.com/drive/v3/web/support), so you might want to try using their tags on stack overflow or their issue tracking to ask questions as the server team checks there.

TVL
Reply all
Reply to author
Forward
0 new messages