FB Login using Swift 3 not returning any values and not get back the user to the App after successful login

后端 未结 7 2303
南旧
南旧 2021-02-04 09:47

I\'m using iOS 10 Swift 3 to integrate FB Login. I have followed all steps from Facebook documentation. Now the issue is, aft

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-04 10:16

    Evn: iOS 10, XCode 8.3.2, Swift 3, facebook-sdk-swift-0.2.0 Tested and worked.

    Since above answers are indicated as deprecated code, I have changed the syntax.

    https://gist.github.com/jgchoi/097b59d85d6b378a81925be93a62fef9

    import UIKit
    import FacebookCore
    
    @UIApplicationMain
    class AppDelegate: UIResponder, UIApplicationDelegate {
    
      var window: UIWindow?
    
    
      public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
        // Override point for customization after application launch.
    
         return SDKApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
      }
    
        public func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
        return SDKApplicationDelegate.shared.application(app, open: url, options: options)
      }
    
      public func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
        return SDKApplicationDelegate.shared.application(application, open: url)
      }
    }
    }
    

提交回复
热议问题