如何获取Google Drive API IOS文件列表?

use*_*343 3 objective-c ios mime-types google-drive-api

我正在尝试将IOS的Google Drive Api集成.我在这里测试他们的示例程序

DrEdit在上传或下载文件时使用mimetype,例如上传文件时

[GTLUploadParameters uploadParametersWithData:fileContent MIMEType:@"text/plain"];
Run Code Online (Sandbox Code Playgroud)

当api下载它使用的同一个文件时

GTLQueryDrive *query = [GTLQueryDrive queryForFilesList]; query.q = @"mimeType = 'text/plain'";
Run Code Online (Sandbox Code Playgroud)

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

是否有任何其他参数可以帮助我显示所有文件Google Drive.

小智 6

改变的范围在方法authButtonClickedDrEditFilesListViewController.m

替换此范围 kGTLAuthScopeDriveFilekGTLAuthScopeDrive如下

GTMOAuth2ViewControllerTouch *authViewController = 
  [[GTMOAuth2ViewControllerTouch alloc] initWithScope:**kGTLAuthScopeDriveFile**
                                             clientID:kClientId
                                         clientSecret:kClientSecret
                                     keychainItemName:kKeychainItemName
                                             delegate:self
                                     finishedSelector:finishedSelector];
Run Code Online (Sandbox Code Playgroud)

GTMOAuth2ViewControllerTouch *authViewController = 
  [[GTMOAuth2ViewControllerTouch alloc] initWithScope:**kGTLAuthScopeDrive**
                                             clientID:kClientId
                                         clientSecret:kClientSecret
                                     keychainItemName:kKeychainItemName
                                             delegate:self
                                     finishedSelector:finishedSelector];
Run Code Online (Sandbox Code Playgroud)