swift4
xcode9.2
Firebase認証でGoogleとFacebookのログインを実装中です。
Googleのみログインボタンをタップしても無反応です。
画像の通り、Extra argument in callエラーが出ているので
調べてみたところ引数が多いからという理由の様ですが、
どの引数を削ればいいか分かりません。
教えていただければ幸いです。
よろしくお願いします。
(AppDelegateです) import UIKit import Firebase import FirebaseAuth import GoogleSignIn import FBSDKCoreKit import RAMAnimatedTabBarController @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { print("アプリ起動時の処理だよ") FirebaseApp.configure() FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID GIDSignIn.sharedInstance().delegate = self return true } // func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?) { if let error = error { print(error.localizedDescription) return } print("Googleログインが成功したよ") guard let authentication = user.authentication else { return } guard let accessToken = user.authentication.accessToken else { return } let credential = GoogleAuthProvider.credential(withIDToken: authentication.idToken, accessToken: authentication.accessToken) Auth.auth().signIn(with: credential, completion: { (user, error) in if let error = error{ print(error.localizedDescription) return } guard let uid = user?.uid else { return } print("Firebaseに正常にログインしたよ", uid) }) } func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { let handled = FBSDKApplicationDelegate.sharedInstance().application(app, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as!String!, annotation: options[UIApplicationOpenURLOptionsKey.annotation]) GIDSignIn.sharedInstance().handle(url, sourceApplication: options, [UIApplicationOpenURLOptionsKey.sourceApplication] as!String!, annotation: options[UIApplicationOpenURLOptionsKey.annotation]) return handled } func sign(_ signIn: GIDSignIn!, didDisconnectWith user: GIDGoogleUser!, withError error: Error!) { } func applicationWillResignActive(_ application: UIApplication) { print("アプリ閉じそう") } func applicationDidEnterBackground(_ application: UIApplication) { print("アプリ閉じた") } func applicationWillEnterForeground(_ application: UIApplication) { print("アプリ開きそう") } func applicationDidBecomeActive(_ application: UIApplication) { print("アプリ開いた") FBSDKAppEvents.activateApp() //Facebookでも独自のカスタムイベントを定義して記録することができるようです。これいらないか } func applicationWillTerminate(_ application: UIApplication) { print("フリックしてアプリ終了") } }
回答1件
あなたの回答
tips
プレビュー