我正在使用 Google API Client for REST Library 为我的 mac 应用程序实现 Google Drive Api,
- (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);
}];
}
这里是返回值
GTLRDrive_FileList 0x6080002404e0:{种类:“drive#fileList”文件:[5]}
我的驱动器上有 7 个项目,但它只返回 5 个项目?