Integration new facebook SDK by swift

前端 未结 11 1496
情书的邮戳
情书的邮戳 2020-12-23 09:59

Today i tried to integrate facebook SDK to my Swift app but in the quick start on facebook guide page looks a bit different than my old code. How can i convert OBJ-C code be

11条回答
  •  被撕碎了的回忆
    2020-12-23 10:51

    Swift 5 with FBSDKCoreKit (5.3.0)

    Import FBSDKCoreKit in appdelegate

    In didFinishLaunching:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        FBSDKCoreKit.ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
        return true
    }
    

    In open Url:

      func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
        let handled = FBSDKCoreKit.ApplicationDelegate.shared.application(app, open: url, options: options)
        return handled
    }
    

提交回复
热议问题