我正在尝试集成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];