以前处理过fbsdkloginkit,我必须为我的appdelegate.swift使用某些代码。用于Facebook登录工作以工作以下如下所示:
import FBSDKLoginKit
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let fbLaunch = FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
return fbLaunch
}
func applicationWillResignActive(_ application: UIApplication) {
FBSDKAppEvents.activateApp()
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
}
现在我切换到FacebookLogin,它们的上述代码是什么?
找到了答案,必须用特定的关键字来搜索谷歌,我认为它可能已经过时了(从2016年开始(,但答案在下面的链接中:
https://github.com/facebook/facebook-sdk-swift/blob/master/samples/catalog/sources/sources/appdelegate.swift
它在编译后在我的Xcode上运行