我讀過一些類似的問題,不幸的是,這並沒有真正幫助我很多。Facebook和谷歌登錄 - 衝突(Xcode)
我有一個使用Swift的Xcode項目,目前我已經整合了Twitter & Facebook登錄。我也想要Google登錄。我遵循的步驟,到目前爲止,但我已經達到2個問題:
didFinishLaunchingWithOptions
(在AppDelegate.swift)。我已經有Facebook作爲返回類型,但在Google的文檔中說它需要return true
。怎麼做?下面的代碼:func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Google Login var configureError: NSError? GGLContext.sharedInstance().configureWithError(&configureError) assert(configureError == nil, "Error configuring Google services: \(configureError)") //return true -> Expected by Google return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) }
2)openURL
FUNC - 這其中還預計,谷歌相關的回報,但它目前返回的Facebook(根據他們的文檔):
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
// Required By Google?!
return GIDSignIn.sharedInstance().handleURL(url, sourceApplication: sourceApplication, annotation: annotation)
}
所以,我需要這樣幫助處理這些。先謝謝你!
感謝它的工作。你能解釋讓b = FBSDK ......任務的目的嗎? –