如何使用ios框架获取谷歌驱动器中所有文件的名称

时间:2013-01-20 00:57:08

标签: ios google-drive-api

无法获取在Google云端硬盘目录中指定数据后创建的所有文件名列表:

query = [GTLQueryDrive queryForFilesList];
//query.q = @"mimeType = 'text/plain'";
//query.q = @"mimeType = 'image/png'";
query.q = @"modifiedDate > '20011-06-04T12:00:00'";
authController = [[GTMOAuth2ViewControllerTouch alloc] in itWithScope:kGTLAuthScopeDrive clientID:kClientID  clientSecret:kClientSecret keychainItemName:kKeychainItemName delegate:self 

2 个答案:

答案 0 :(得分:2)

更改了DrEditFilesListViewController.m的方法authButtonClicked中的范围

将此范围kGTLAuthScopeDriveFile替换为kGTLAuthScopeDrive,如下所示

GTMOAuth2ViewControllerTouch *authViewController = [[GTMOAuth2ViewControllerTouch alloc] initWithScope:kGTLAuthScopeDriveFile
                                         clientID:kClientId
                                     clientSecret:kClientSecret
                                 keychainItemName:kKeychainItemName
                                         delegate:self
                                 finishedSelector:finishedSelector];

GTMOAuth2ViewControllerTouch *authViewController = [[GTMOAuth2ViewControllerTouch alloc] initWithScope:kGTLAuthScopeDrive
                                         clientID:kClientId
                                     clientSecret:kClientSecret
                                 keychainItemName:kKeychainItemName
                                         delegate:self
                                 finishedSelector:finishedSelector];

答案 1 :(得分:0)

检查您的日期:

query.q = @"modifiedDate > '20011-06-04T12:00:00'";

您要使用2011-06-04吗?如果是,那么:

query.q = @"modifiedDate > '2011-06-04T12:00:00'";