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

后端 未结 7 2071
南旧
南旧 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:20

    Hi I raised this issue to facebook developer support and the issue is that I have not implemented the correct delegate methods for iOS10. and you can find the correct delegate implementation here

    import UIKit
    import CoreData
    
    @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 FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
    }
    
     public func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
    
    return FBSDKApplicationDelegate.sharedInstance().application(
      app,
      open: url as URL!,
      sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String,
      annotation: options[UIApplicationOpenURLOptionsKey.annotation]
    )
    }
    
    public func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
    return FBSDKApplicationDelegate.sharedInstance().application(
      application,
      open: url as URL!,
      sourceApplication: sourceApplication,
      annotation: annotation)
    }
    }
    

提交回复
热议问题