I can seem to understand the problem and I am also receiving error " Use of undeclared type "GIDSignInUIDelegate"
I have tried to reinstall pods, I have all pods needed inside pod file including "GoogleSignIn"
I can't seem to find anything online about the Extra argument either.
import UIKit
import Firebase
import GoogleSignIn
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID
window = UIWindow()
window?.makeKeyAndVisible()
let navController = UINavigationController(rootViewController: HomeController())
navController.navigationBar.barStyle = .black
window?.rootViewController = navController
return true
}
func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any])
-> Bool {
return GIDSignIn.sharedInstance().handle(url,
sourceApplication:options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
annotation: [:])
}
I receive error:
Extra Argument 'sourceApplication'
in call beside:
func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any])
-> Bool {
return GIDSignIn.sharedInstance().handle(url,
sourceApplication:options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
annotation: [:])
}
I can seem to understand the problem and I am also receiving error " Use of undeclared type "GIDSignInUIDelegate"
2019-08-14 -- v5.0.0
Changes to GIDSignIn: uiDelegate has been replaced with presentingViewController.
the GIDSignInUIDelegate was required to assign self to the uiDelegate.
Since the change that to presentingViewController, you can assign self directly and don't need the delegate anymore so they removed it.
GIDSignIn.sharedInstance()?.uiDelegate = self
is now
GIDSignIn.sharedInstance()?.presentingViewController = self
and as @efremidze indicated in his reply,
GIDSignIn.sharedInstance().handle(url, sourceApplication:options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: [:])
is now simply
GIDSignIn.sharedInstance().handle(url)
You might be using v5.0.0 of GIDSignIn. They made some changes to handle()
parameters.
@available(iOS 9.0, *)
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool {
return GIDSignIn.sharedInstance().handle(url)
}
https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift https://developers.google.com/identity/sign-in/ios/release
According to the release note of Google Sign-In:
2019-08-14 -- v5.0.0
Changes to GIDSignIn: uiDelegate has been replaced with presentingViewController.
To fix the errors:
1. replace all
GIDSignIn.sharedInstance().uiDelegate = yourDelegate
with
GIDSignIn.sharedInstance().presentingViewController = yourDelegate
2. Remove all the conformances to GIDSignInUIDelegate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With