I've read some of the similar questions here, unfortunately, didn't really help me much.
I have an Xcode project using Swift, currently, I've integrated Twitter & Facebook login. I would like to have Google login as well. I've followed the steps so far, but I've reach to 2 issues:
didFinishLaunchingWithOptions
(in AppDelegate.swift). I already have Facebook as a return type, but in Google's documentation it says it requiresreturn true
. How to do that? Here's the code: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 - This one also expects Google related return but it currently returns Facebook (based on their documentation):
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)
}
So, I need so help on handling those. Thank you in advance!
for me this one worked
and
hope help someone. was working on it for morethan 3 hours.
The solution is
In
didFinishLaunchingWithOptions
take a one boolean variable and than return that variable likeFor the other issue, you can handle it like this