2017-04-17 28 views
2

我想GTMAppAuth和整合的GDrive如下步驟發現:GTMAppAuth 'presentingViewController' 不是在函數聲明

$吊艙安裝

target 'GTMAppAuth Drive Example iOS' do 
    platform :ios, '8.0' 

    pod 'GTMAppAuth' 
    pod 'GoogleAPIClientForREST/Drive' 
end 

$打開示例 - iOS.xcworkspace

https://github.com/google/GTMAppAuth/tree/master/Example-iOS

將客戶端ID從Google控制檯複製到剪貼板。 在GTMAppAuthExampleViewController.m中用新的客戶端ID更新kClientID。

最後,打開Info.plist並完全展開「URL類型」(又名「CFBundleURLTypes」),並將com.googleusercontent.apps.YOUR_CLIENT替換爲客戶端ID的反向DNS表示法(不包括:/ oauthredirect路徑零件)。

但是 爲什麼在評論中發生錯誤? 我的版本的Xcode 8.3.1是

enter image description here

回答

5

上有AppAuth未的github上打開的問題:https://github.com/google/GTMAppAuth/issues/21

現在的解決方法似乎是這一行添加到Podfile:
pod 'AppAuth', :inhibit_warnings => true

+0

當我添加此行並重新編譯它之後。 Xcode顯示「找不到-lAppAuth的檔案庫」 –

+0

我將「只建立活動架構」設定爲「否」。-lAppAuth問題解決 –