如何在Swift iOS应用程序中添加Google Drive API?

如何在Swift iOS应用程序中添加Google Drive API?

问题描述:

我有一个用Swift编写的应用程序,该应用程序已经使用了SwiftyDropbox API。
我用cocoapods和 use_frameworks!关键字安装了SwiftyDropbox。
现在,当我将此Pod 'Google-API-Client'添加到我的Podfile中时,我在尝试使用Google Drive API时出现重复定义错误来构建我的项目。

I have an application written in Swift which already uses the SwiftyDropbox API. I installed SwiftyDropbox with cocoapods and the use_frameworks! keyword. And now, when I add this pod 'Google-API-Client' to my Podfile, I get a Duplicate definition error in my Google Drive API when I tried to build my project.

因此,我决定遵循Google云端硬盘指南: https://developers.google.com/drive/ios/quickstart?ver=swift

So, I've decided to follow the Google Drive guide : https://developers.google.com/drive/ios/quickstart?ver=swift

但是该指南似乎已被弃用,因为其中没有名为 GTL.xcodeproj GTMSessionFetcher.xcodeproj 的文件按照本教程下载的文件。他们描述的所有步骤似乎都不一致。

But it seems this guide is deprecated, because there is no file named GTL.xcodeproj or GTMSessionFetcher.xcodeproj in the files we download by following this tutorial. And all the steps they describes seems to be inconsistent.

所以我不知道在iOS项目中如何使用SwiftyDropbox和Google Drive API。

So I don't know what can I do to work with SwiftyDropbox and Google Drive API in my iOS project.

只是查看了仓库,它在去年1月13日进行了更新,可能会影响xcodeproject的命名。

Just looked into the repo, it had an update last Jan 13 that may have affected the naming of the xcodeproject.

当前,然后是步骤3.b项目

Currently, the Step 3.b project will then be


  • google-api-objectivec-client / Source / GTLCore.xcodeproj

  • gtm-session-fetcher / Source / GTMSessionFetcherCore.xcodeproj

  • google-api-objectivec-client/Source/GTLCore.xcodeproj
  • gtm-session-fetcher/Source/GTMSessionFetcherCore.xcodeproj

希望这对导入项目有所帮助。

Hopefully this is a bit of help with importing the project.