如何获取文件列表Google Drive API iOS



我正在尝试集成iOS的Google Drive API。我在这里测试他们的示例程序

dredit上传或下载文件时使用的模仿类型,例如上传文件

[GTLUploadParameters uploadParametersWithData:fileContent MIMEType:@"text/plain"];

当API下载与使用

的同一文件时
GTLQueryDrive *query = [GTLQueryDrive queryForFilesList]; query.q = @"mimeType = 'text/plain'";

我可以上传和下载Dr.Edit中制作的文件,但是如果我使用Web界面修改或创建文件或使用本地驱动器客户端进行mac os。这些文件未显示在我的应用程序中。我尝试了不同的模拟型和不同的搜索参数。但它仅适用于在Dr.Edit中创建的文件。问题是什么?

还有其他参数可以帮助我在Google Drive中显示所有文件。

更改了DrEditFilesListViewController.m

的方法authButtonClicked中的范围

kGTLAuthScopeDrive替换此范围kGTLAuthScopeDriveFile如下

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

to

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

最新更新