Actually i integrated google drive sdk with my ios app. I can able to retrieve/upload the files in google drive through google drive ios sdk. But the retrieving files list from specified parent folder taking so much time.
Here the steps and the code which was i am using.
First am getting the children's of the specified parent folder then am getting the GTLDriveChildReference of each child then then am querying with the child reference identifier.
This is huge process for me. Also it request google server each time. Any better way there to just pass the parent folder id in a query and pulling the files from that parent folder.
-(void)getFileListFromSpecifiedParentFolder {
GTLQueryDrive *query2 = [GTLQueryDrive queryForChildrenListWithFolderId:<some_id or root>];
query2.maxResults = 1000;
// queryTicket can be used to track the status of the request.
[self.driveService executeQuery:query2
completionHandler:^(GTLServiceTicket *ticket,
GTLDriveChildList *children, NSError *error) {
NSLog(@"\nGoogle Drive: file count in the folder: %d", children.items.count);
//incase there is no files under this folder then we can avoid the fetching process
if (!children.items.count) {
return ;
}
if (error == nil) {
for (GTLDriveChildReference *child in children) {
GTLQuery *query = [GTLQueryDrive queryForFilesGetWithFileId:child.identifier];
// queryTicket can be used to track the status of the request.
[self.driveService executeQuery:query
completionHandler:^(GTLServiceTicket *ticket,
GTLDriveFile *file,
NSError *error) {
NSLog(@"\nfile name = %@", file.originalFilename);
}];
}
}
}];
}
Any help that might be appreciated.